Represents the collection of all search jobs.

package Splunk

 Methods

Creates a new search job.

create(string $search, array $args) : \Splunk_Job

Parameters

$search

string

The search query for the job to perform.

$args

array

(optional) Job-specific creation arguments, merged with {
namespace: (optional) {Splunk_Namespace} The namespace in which to create the entity. Defaults to the service's namespace.
}
For details, see the "POST search/jobs" endpoint in the REST API Documentation.

Exceptions

\Splunk_IOException

Returns

Executes the specified search query and returns results immediately.

createOneshot(string $search, array $args) : string

Parameters

$search

string

The search query for the job to perform.

$args

array

(optional) Job-specific creation arguments, merged with {
namespace: (optional) {Splunk_Namespace} The namespace in which to create the entity. Defaults to the service's namespace.
}
For details, see the "POST search/jobs" endpoint in the REST API Documentation.

Exceptions

\Splunk_IOException

Returns

stringThe search results, which can be parsed with Splunk_ResultsReader.

Deletes an entity from this collection.

delete(string $name, array $args) 
Inherited
inherited_from \Splunk_Collection::delete()

Parameters

$name

string

The name of the entity to delete.

$args

array

(optional) Entity-specific deletion arguments, merged with {
namespace: (optional) {Splunk_Namespace} The namespace in which to find the entity. Defaults to the service's namespace.
}

Exceptions

\Splunk_IOException

Returns the unique entity with the specified name in this collection.

get(string $name, \Splunk_Namespace | NULL $namespace) : \Splunk_Entity
see \Splunk_Collection::get()

Parameters

$name

string

The name of the entity to search for.

$namespace

\Splunk_NamespaceNULL

(optional) {Splunk_Namespace} The namespace in which to search. Defaults to the service's namespace.

Exceptions

\Splunk_NoSuchEntityException If no such entity exists.
\Splunk_AmbiguousEntityNameException If multiple entities with the specified name exist in the specified namespace.
\Splunk_IOException

Returns

Returns a reference to the unique entity with the specified name in this collection.

getReference(string $name, \Splunk_Namespace | NULL $namespace) : \Splunk_Entity
Inherited

Loading of the entity is deferred until its first use.

inherited_from \Splunk_Collection::getReference()

Parameters

$name

string

The name of the entity to search for.

$namespace

\Splunk_NamespaceNULL

(optional) {Splunk_Namespace} The namespace in which to search. Defaults to the service's namespace.

Returns

Lists this collection's entities, returning a list of loaded entities.

items(array $args) : array
Inherited

By default, all items in the collection are returned. For large collections, it is advisable to fetch items using multiple calls with the paging options (i.e. 'offset' and 'count').

inherited_from \Splunk_Collection::items()

Parameters

$args

array

(optional) {
namespace: (optional) {Splunk_Namespace} The namespace in which to list entities. Defaults to the service's namespace.
count: (optional) The maximum number of items to return, or -1 to return as many as possible. Defaults to returning as many as possible.
offset: (optional) The offset of the first item to return. Defaults to 0.
search: (optional) The search expression to filter responses with. For example, "foo" matches any object that has "foo" in a substring of a field. Similarly the expression "field_name=field_value" matches only objects that have a "field_name" field with the value "field_value".
sort_dir: (optional) The direction to sort returned items.
Valid values:
- "asc": Sort in ascending order.
- "desc": Sort in descending order.
Defaults to "asc".
sort_key: (optional) The field to use for sorting. Defaults to "name".
sort_mode: (optional) The sorting algorithm to use. Valid values:
- "auto": If all values of the field are numbers, sort numerically. Otherwise, sort alphabetically.
- "alpha": Sort alphabetically.
- "alpha_case": Sort alphabetically, case-sensitive.
- "num": Sort numerically.
Defaults to "auto".
}

Exceptions

\Splunk_IOException

Returns

arraythe entities in the listing.

Sends an HTTP DELETE request relative to this endpoint.

sendDelete(string $relativePath, array $args) : \Splunk_HttpResponse
Inherited
see \Splunk_Http::delete()
inherited_from \Splunk_Endpoint::sendDelete()
inherited_from \Splunk_Collection::sendDelete()

Parameters

$relativePath

string

relative URL path.

$args

array

(optional) query parameters, merged with {
namespace: (optional) namespace to use, or NULL to use the context's default namespace.
}

Exceptions

\Splunk_IOException

Returns

\Splunk_HttpResponse

Sends an HTTP GET request relative to this endpoint.

sendGet(string $relativePath, array $args) : \Splunk_HttpResponse
Inherited
see \Splunk_Http::get()
inherited_from \Splunk_Endpoint::sendGet()
inherited_from \Splunk_Collection::sendGet()

Parameters

$relativePath

string

relative URL path.

$args

array

(optional) query parameters, merged with {
namespace: (optional) namespace to use, or NULL to use the context's default namespace.
}

Exceptions

\Splunk_IOException

Returns

\Splunk_HttpResponse

Sends an HTTP POST request relative to this endpoint.

sendPost(string $relativePath, array $args) : \Splunk_HttpResponse
Inherited
see \Splunk_Http::post()
inherited_from \Splunk_Endpoint::sendPost()
inherited_from \Splunk_Collection::sendPost()

Parameters

$relativePath

string

relative URL path.

$args

array

(optional) form parameters to send in the request body, merged with {
namespace: (optional) namespace to use, or NULL to use the context's default namespace.
}

Exceptions

\Splunk_IOException

Returns

\Splunk_HttpResponse

Ensures that the specified name is not NULL or empty.

checkName($name) 
Inherited
inherited_from \Splunk_Collection::checkName()

Parameters

$name

Ensures that the specified namespace is a Splunk_Namespace if it is not NULL.

checkNamespace($namespace) 
Inherited
inherited_from \Splunk_Collection::checkNamespace()

Parameters

$namespace

Not implemented.

getSearchNamespace() : \Splunk_Namespace | NULL
Inherited
inherited_from \Splunk_Collection::getSearchNamespace()

Returns

\Splunk_NamespaceNULLThe namespace in which this endpoint resides, or NULL to use the context's default namespace. Possibly a non-exact namespace.

Returns the absolute path of the child entity with the specified name.

getEntityPath($name) 
Inherited
inherited_from \Splunk_Collection::getEntityPath()

Parameters

$name

Returns the relative path of the child entity with the specified name.

getEntityRelativePath($name) 
Inherited
inherited_from \Splunk_Collection::getEntityRelativePath()

Parameters

$name

Returns an array of entities from the given response.

loadEntitiesFromResponse($response) : array
Inherited
inherited_from \Splunk_Collection::loadEntitiesFromResponse()

Parameters

$response

Returns

arrayarray of Splunk_Entry.

Returns an entity from the given entry element.

loadEntityFromEntry(\SimpleXMLElement $entry) : \Splunk_Entry
Inherited
inherited_from \Splunk_Collection::loadEntityFromEntry()

Parameters

$entry

\SimpleXMLElement

an element.

Returns

\Splunk_Entry

Sends a simple request relative to this endpoint.

sendSimpleRequest($method, $relativePath, $args) 
Inherited
inherited_from \Splunk_Endpoint::sendSimpleRequest()
inherited_from \Splunk_Collection::sendSimpleRequest()

Parameters

$method

$relativePath

$args

 Properties

 

$path 
Inherited
inherited_from \Splunk_Endpoint::$$path
inherited_from \Splunk_Collection::$$path
 

$service 
Inherited
inherited_from \Splunk_Endpoint::$$service
inherited_from \Splunk_Collection::$$service
 

$entitySubclass 
Inherited
inherited_from \Splunk_Collection::$$entitySubclass