Provides an object-oriented interface to access entities of a Splunk server.
package | Splunk |
---|
__construct(array $args)
see | \Splunk_Context::__construct() |
---|
array
{
username: (optional) The username to login with. Defaults to
"admin".
password: (optional) The password to login with. Defaults to
"changeme".
token: (optional) The authentication token to use. If provided,
the username and password are ignored and there is no
need to call login(). In the format "Splunk SESSION_KEY".
host: (optional) The hostname of the Splunk server. Defaults to
"localhost".
port: (optional) The port of the Splunk server. Defaults to
8089.
scheme: (optional) The scheme to use: either "http" or "https".
Defaults to "https".
namespace: (optional) Namespace that all object lookups will
occur in by default. Defaults to
Splunk_Namespace::createDefault()
.
http: (optional) An Http object that will be used for
performing HTTP requests. This is intended for testing
only.
}
getHost() : string
inherited_from | \Splunk_Context::getHost() |
---|
string
The hostname of the Splunk server.getIndexes() : \Splunk_Collection
\Splunk_Collection
The collection of indexes on this server.getJobs() : \Splunk_Jobs
\Splunk_Jobs
The collection of search jobs on this server.getNamespace() : \Splunk_Namespace
inherited_from | \Splunk_Context::getNamespace() |
---|
\Splunk_Namespace
The default namespace that will be used
to perform collection and entity operations
when none is explicitly specified.getPort() : string
inherited_from | \Splunk_Context::getPort() |
---|
string
The port of the Splunk server.getReceiver() : \Splunk_Receiver
\Splunk_Receiver
An interface to send events to this server.getSavedSearches() : \Splunk_Collection
\Splunk_Collection
The collection of saved searches on this server.getScheme() : string
inherited_from | \Splunk_Context::getScheme() |
---|
string
The scheme to use: either "http" or "https".getToken() : string
inherited_from | \Splunk_Context::getToken() |
---|
string
The token used to authenticate HTTP requests
after logging in.login()
inherited_from | \Splunk_Context::login() |
---|
oneshotSearch(string $search, array $args) : string
string
The search query for the job to perform.
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.
\Splunk_IOException |
---|
string
The search results, which can be parsed with
Splunk_ResultsReader.search(string $search, array $args) : \Splunk_Job
string
The search query for the job to perform.
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.
\Splunk_IOException |
---|
sendDelete(string $path, array $args) : \Splunk_HttpResponse
see | \Splunk_Http::delete() |
---|---|
inherited_from | \Splunk_Context::sendDelete() |
string
relative or absolute URL path.
array
(optional) query parameters, merged with {
namespace: (optional) namespace to use, or NULL to use
this context's default namespace.
}
\Splunk_IOException |
---|
\Splunk_HttpResponse
sendGet(string $path, array $args) : \Splunk_HttpResponse
see | \Splunk_Http::get() |
---|---|
inherited_from | \Splunk_Context::sendGet() |
string
relative or absolute URL path.
array
(optional) query parameters, merged with {
namespace: (optional) namespace to use, or NULL to use
this context's default namespace.
}
\Splunk_IOException |
---|
\Splunk_HttpResponse
sendPost(string $path, array $args) : \Splunk_HttpResponse
see | \Splunk_Http::post() |
---|---|
inherited_from | \Splunk_Context::sendPost() |
string
relative or absolute URL path.
array
(optional) form parameters to send in the
request body, merged with {
namespace: (optional) namespace to use, or NULL to use
this context's default namespace.
}
\Splunk_IOException |
---|
\Splunk_HttpResponse
sendRequest(string $method, string $path, array $requestHeaders, string $requestBody, array $args) : \Splunk_HttpResponse
see | \Splunk_Http::request() |
---|---|
inherited_from | \Splunk_Context::sendRequest() |
string
the HTTP method (ex: 'GET' or 'POST').
string
relative or absolute URL path.
array
(optional) dictionary of header names and values.
string
(optional) content to send in the request.
array
(optional) query parameters, merged with
{
namespace: (optional) namespace to use, or NULL to use
this context's default namespace.
}
\Splunk_IOException |
---|
\Splunk_HttpResponse
abspath(string $path, \Splunk_Namespace | NULL $namespace) : string
inherited_from | \Splunk_Context::abspath() |
---|
string
Relative or absolute URL path.
string
Absolute URL path.getRequestHeaders()
inherited_from | \Splunk_Context::getRequestHeaders() |
---|
sendSimpleRequest($method, $path, $args)
inherited_from | \Splunk_Context::sendSimpleRequest() |
---|
url(string $path, \Splunk_Namespace | NULL $namespace) : string
inherited_from | \Splunk_Context::url() |
---|
string
Relative or absolute URL path.
string
Absolute URL.$host
inherited_from | \Splunk_Context::$$host |
---|
$http
inherited_from | \Splunk_Context::$$http |
---|
$namespace
inherited_from | \Splunk_Context::$$namespace |
---|
$password
inherited_from | \Splunk_Context::$$password |
---|
$port
inherited_from | \Splunk_Context::$$port |
---|
$scheme
inherited_from | \Splunk_Context::$$scheme |
---|
$token
inherited_from | \Splunk_Context::$$token |
---|
$username
inherited_from | \Splunk_Context::$$username |
---|