init

splunkjs.StormService.init

Constructor for splunkjs.StormService.

Syntax

init: function(http, params)

Parameters

Name Type Description
http splunkjs.Http

An instance of a splunkjs.Http class.

params Object

A dictionary of parameters:
- token: The API token for Storm.

Return

splunkjs.StormService.

A new splunkjs.StormService instance.

log

splunkjs.StormService.log
Endpoint: inputs/http

Logs an event to Splunk Storm.

Syntax

log: function(event, params, callback)

Parameters

Name Type Description
event String,Object

The text for this event, or an object to convert to JSON.

params Object

A dictionary of parameters for indexing:
- project: The project to send events from this input to (use your project token).
- host: The value to populate in the Host field for this input's events.
- source: The value to populate in the Source field for this input's events.
- sourcetype: The value to populate in the Sourcetype field for this input's events.
- TZ: The timezone to apply to this input's events.

callback Function

A function to call when the event is submitted: (err, result).

Examples

storm.log(
    "My awesome log message", 
    {project: "XYZ123", sourcetype: "GO"},
    function(err, response) {
        console.log("Data is in Storm!");         
    }
);