Provides methods for logging events to a Splunk index.

package Splunk

 Methods

Creates a stream for logging events to the specified index.

attach(array $args) : resource

In addition to the index name it is highly recommended to specify a sourcetype explicitly.

The returned stream should eventually be closed via fclose().

link http://docs.splunk.com/Documentation/Splunk/latest/RESTAPI/RESTinput#receivers.2Fstream

Parameters

$args

array

(optional) {
host: (optional) The value to populate in the host field for events from this data input.
host_regex: (optional) A regular expression used to extract the host value from each event.
index: (optional) The index to send events from this input to. Highly recommended. Defaults to "default".
source: (optional) The source value to fill in the metadata for this input's events.
sourcetype: (optional) The sourcetype to apply to events from this input.
}

Exceptions

\Splunk_IOException

Returns

resourceA stream that you can write event text to.

Logs one or more events to the specified index.

submit(string $data, array $args) 

In addition to the index name it is highly recommended to specify a sourcetype explicitly.

link http://docs.splunk.com/Documentation/Splunk/latest/RESTAPI/RESTinput#receivers.2Fsimple

Parameters

$data

string

Raw event text. This may contain data for multiple events. Under the default configuration, line breaks ("\n") can be inserted to separate multiple events.

$args

array

(optional) {
host: (optional) The value to populate in the host field for events from this data input.
host_regex: (optional) A regular expression used to extract the host value from each event.
index: (optional) The index to send events from this input to. Highly recommended. Defaults to "default".
source: (optional) The source value to fill in the metadata for this input's events.
sourcetype: (optional) The sourcetype to apply to events from this input.
}

Exceptions

\Splunk_IOException

 Properties

 

$service