Splunk

Splunk indexes machine data — logs, metrics, and events — and makes it searchable with SPL, its search processing language. Teams use it for operational monitoring, incident investigation, and security analytics, with saved searches and alerts watching for conditions on a schedule.

With the Splunk integration in Sim, you can:

  • Run searches: Execute an SPL search synchronously and get its results in a single call
  • Run long searches as jobs: Create a search job, check its status, page through its results, and cancel it
  • Use saved searches: List and get saved searches, and dispatch one on demand
  • Inspect alerts: List fired alerts and get the fired instances of a specific alert
  • Explore the instance: List indexes and installed apps

In Sim, the Splunk integration enables your agents to investigate and act on operational data. An agent can run a search when an incident opens, dispatch a saved search to reproduce a known query, page through a large job's results, and read fired alerts to decide what to escalate. It works against both Splunk Enterprise and Splunk Cloud, authenticating with a bearer token.

Usage Instructions

Integrate Splunk Enterprise or Splunk Cloud into workflows. Run SPL searches synchronously or as asynchronous jobs, fetch results, dispatch saved searches, and inspect fired alerts and indexes.

Actions

Run an SPL search synchronously and return its results in a single call (oneshot mode). A oneshot search buffers the whole result set in one response with no paging, so use it for short searches; for anything large use Create Search Job with Get Search Results, which defaults to 100 rows and pages with offset.

Input

ParameterTypeRequiredDescription
baseUrlstringYesSplunk management URL including the management port (e.g. https://splunk.example.com:8089\)
authTokenstringNoSplunk authentication token, sent as a bearer token. Preferred over a password.
usernamestringNoSplunk username, used for basic authentication when no token is supplied
passwordstringNoSplunk password, used for basic authentication when no token is supplied
ownerstringNoNamespace owner for /servicesNS requests (e.g. admin, or nobody for app-shared objects). Leave both this and the app empty to use the authenticated user context; set only one and the other becomes the - wildcard.
appstringNoNamespace app context for /servicesNS requests (e.g. search). Leave both this and the owner empty to use the authenticated user context; set only one and the other becomes the - wildcard.
searchstringYesSPL search string (e.g. index=main error | stats count by host). The leading "search" command is added automatically when omitted.
earliestTimestringNoEarliest (inclusive) time bound — relative (e.g. -24h, -7d@d) or absolute epoch/formatted time
latestTimestringNoLatest (exclusive) time bound — relative (e.g. now) or absolute time
adhocSearchLevelstringNoSearch mode: verbose, fast, or smart. Defaults to fast.
autoCancelnumberNoCancel the search after this many seconds of inactivity (e.g. 60). 0 never auto-cancels.
maxCountnumberNoNumber of events accessible in any given status bucket, and in transforming mode the maximum number of results to store. Defaults to 10000.

Output

ParameterTypeDescription
resultsarrayResult rows. Each row holds the fields produced by the search.
resultCountnumberNumber of result rows returned in this response
previewbooleanWhether these are preview results from a still-running job
initOffsetnumberOffset of the first returned row within the full result set
messagesarraySearch messages returned alongside the results
typestringMessage severity
textstringMessage text

Splunk Create Search Job

Start a Splunk search job and return its search ID (sid). The search runs asynchronously — poll its status and fetch results separately.

Input

ParameterTypeRequiredDescription
baseUrlstringYesSplunk management URL including the management port (e.g. https://splunk.example.com:8089\)
authTokenstringNoSplunk authentication token, sent as a bearer token. Preferred over a password.
usernamestringNoSplunk username, used for basic authentication when no token is supplied
passwordstringNoSplunk password, used for basic authentication when no token is supplied
ownerstringNoNamespace owner for /servicesNS requests (e.g. admin, or nobody for app-shared objects). Leave both this and the app empty to use the authenticated user context; set only one and the other becomes the - wildcard.
appstringNoNamespace app context for /servicesNS requests (e.g. search). Leave both this and the owner empty to use the authenticated user context; set only one and the other becomes the - wildcard.
searchstringYesSPL search string (e.g. index=main sourcetype=access_combined | timechart count). The leading "search" command is added automatically when omitted.
earliestTimestringNoEarliest (inclusive) time bound — relative (e.g. -24h) or absolute time
latestTimestringNoLatest (exclusive) time bound — relative (e.g. now) or absolute time
execModestringNoExecution mode: normal (returns the sid immediately) or blocking (returns the sid once the job completes). Defaults to normal. oneshot is rejected here because it returns results instead of a sid — use Splunk Run Search for that.
adhocSearchLevelstringNoSearch mode: verbose, fast, or smart. Defaults to fast.
searchIdstringNoCustom search ID to assign to the job. A random ID is generated when omitted.
indexEarlieststringNoEarliest (inclusive) time bound based on index time rather than event time
indexLateststringNoLatest (exclusive) time bound based on index time rather than event time
enableLookupsbooleanNoWhether lookups are applied to events. Defaults to true.
allowPartialResultsbooleanNoWhether the job may return partial results when a search peer fails. Defaults to true.
autoCancelnumberNoCancel the job after this many seconds of inactivity (e.g. 300). 0 never auto-cancels.
maxCountnumberNoNumber of events accessible in any given status bucket, and in transforming mode the maximum number of results to store. Defaults to 10000.

Output

ParameterTypeDescription
sidstringSearch ID of the created job, used to poll status and fetch results

Splunk Get Search Job

Get the status and progress of a Splunk search job by search ID, including dispatch state, completion progress, and event/result counts.

Input

ParameterTypeRequiredDescription
baseUrlstringYesSplunk management URL including the management port (e.g. https://splunk.example.com:8089\)
authTokenstringNoSplunk authentication token, sent as a bearer token. Preferred over a password.
usernamestringNoSplunk username, used for basic authentication when no token is supplied
passwordstringNoSplunk password, used for basic authentication when no token is supplied
ownerstringNoNamespace owner for /servicesNS requests (e.g. admin, or nobody for app-shared objects). Leave both this and the app empty to use the authenticated user context; set only one and the other becomes the - wildcard.
appstringNoNamespace app context for /servicesNS requests (e.g. search). Leave both this and the owner empty to use the authenticated user context; set only one and the other becomes the - wildcard.
sidstringYesSearch ID of the job to inspect (e.g. 1457683115.100)

Output

ParameterTypeDescription
sidstringSearch ID of the job
labelstringCustom name created for this search
dispatchStatestringJob state: QUEUED, PARSING, RUNNING, FINALIZING, PAUSE, INTERNAL_CANCEL, USER_CANCEL, BAD_INPUT_CANCEL, QUIT, FAILED, or DONE
doneProgressnumberApproximate progress between 0 and 1.0
isDonebooleanWhether the search has completed
isFailedbooleanWhether a fatal error occurred running the search
isFinalizedbooleanWhether the search was finalized (stopped before completion)
isPausedbooleanWhether the search is paused
isZombiebooleanWhether the search process died before the search finished
isSavedbooleanWhether the search job artifacts are saved to disk
isSavedSearchbooleanWhether this is a saved search run by the scheduler
isRealTimeSearchbooleanWhether this is a real-time search
eventCountnumberNumber of events returned by the search
eventAvailableCountnumberNumber of events available for export
eventFieldCountnumberNumber of fields found in the search results
resultCountnumberTotal number of results returned by the search
resultPreviewCountnumberNumber of result rows in the latest preview results
scanCountnumberNumber of events scanned or read off disk
runDurationnumberTime in seconds the search took to complete
prioritynumberSearch priority between 0 and 10
earliestTimestringEarliest (inclusive) time bound for the search
latestTimestringLatest (exclusive) time bound for the search
searchEarliestTimenumberEarliest time as specified in the search command itself, as an epoch timestamp. Unlike earliestTime, which the job entry renders as an ISO string, this pair is documented as bare numbers (e.g. 1308589800.000000000).
searchLatestTimenumberLatest time as specified in the search command itself, as an epoch timestamp. Unlike latestTime, which the job entry renders as an ISO string, this pair is documented as bare numbers.
messagesjsonErrors and debug messages recorded for the job

Splunk Get Search Results

Fetch the transformed results of a completed Splunk search job by search ID, with pagination.

Input

ParameterTypeRequiredDescription
baseUrlstringYesSplunk management URL including the management port (e.g. https://splunk.example.com:8089\)
authTokenstringNoSplunk authentication token, sent as a bearer token. Preferred over a password.
usernamestringNoSplunk username, used for basic authentication when no token is supplied
passwordstringNoSplunk password, used for basic authentication when no token is supplied
ownerstringNoNamespace owner for /servicesNS requests (e.g. admin, or nobody for app-shared objects). Leave both this and the app empty to use the authenticated user context; set only one and the other becomes the - wildcard.
appstringNoNamespace app context for /servicesNS requests (e.g. search). Leave both this and the owner empty to use the authenticated user context; set only one and the other becomes the - wildcard.
sidstringYesSearch ID of the job whose results to fetch (e.g. 1457683115.100)
countnumberNoMaximum number of result rows to return. Defaults to 100. Page through larger result sets with offset rather than raising this — a completed job can hold millions of rows. 0 is rejected here even though Splunk reads it as "every row".
offsetnumberNoFirst result row (0-indexed) from which to begin returning data
fieldsstringNoComma-separated list of fields to return for each row (e.g. _time,host,source). Returns all fields when omitted.
addSummaryToMetadatabooleanNoInclude field summary statistics in the response

Output

ParameterTypeDescription
resultsarrayResult rows. Each row holds the fields produced by the search.
resultCountnumberNumber of result rows returned in this response
previewbooleanWhether these are preview results from a still-running job
initOffsetnumberOffset of the first returned row within the full result set
messagesarraySearch messages returned alongside the results
typestringMessage severity
textstringMessage text

Splunk Cancel Search Job

Cancel a running Splunk search job and delete its result cache.

Input

ParameterTypeRequiredDescription
baseUrlstringYesSplunk management URL including the management port (e.g. https://splunk.example.com:8089\)
authTokenstringNoSplunk authentication token, sent as a bearer token. Preferred over a password.
usernamestringNoSplunk username, used for basic authentication when no token is supplied
passwordstringNoSplunk password, used for basic authentication when no token is supplied
ownerstringNoNamespace owner for /servicesNS requests (e.g. admin, or nobody for app-shared objects). Leave both this and the app empty to use the authenticated user context; set only one and the other becomes the - wildcard.
appstringNoNamespace app context for /servicesNS requests (e.g. search). Leave both this and the owner empty to use the authenticated user context; set only one and the other becomes the - wildcard.
sidstringYesSearch ID of the job to cancel (e.g. 1457683115.100)

Output

ParameterTypeDescription
sidstringSearch ID of the cancelled job
messagesarrayInformational, warning, and error messages returned with the response
typestringMessage severity (INFO, WARN, ERROR, DEBUG)
textstringMessage text

Splunk List Saved Searches

List saved searches and reports configured in Splunk, including their SPL, schedule, and alert configuration.

Input

ParameterTypeRequiredDescription
baseUrlstringYesSplunk management URL including the management port (e.g. https://splunk.example.com:8089\)
authTokenstringNoSplunk authentication token, sent as a bearer token. Preferred over a password.
usernamestringNoSplunk username, used for basic authentication when no token is supplied
passwordstringNoSplunk password, used for basic authentication when no token is supplied
ownerstringNoNamespace owner for /servicesNS requests (e.g. admin, or nobody for app-shared objects). Leave both this and the app empty to use the authenticated user context; set only one and the other becomes the - wildcard.
appstringNoNamespace app context for /servicesNS requests (e.g. search). Leave both this and the owner empty to use the authenticated user context; set only one and the other becomes the - wildcard.
searchstringNoFilter saved searches. A bare term matches as a substring across fields (e.g. Errors); field_name=field_value matches one field (e.g. is_scheduled=1).
countnumberNoMaximum number of saved searches to return (e.g. 50). 0 returns all.
offsetnumberNoIndex of the first saved search to return, for pagination

Output

ParameterTypeDescription
savedSearchesarraySaved searches configured in Splunk
namestringSaved search name
idstringFully qualified REST URI of the saved search
authorstringOwner of the saved search
updatedstringLast update timestamp
searchstringThe SPL the saved search runs
qualifiedSearchstringThe exact search string the scheduler runs
descriptionstringSaved search description
disabledbooleanWhether the saved search is disabled
isScheduledbooleanWhether the search runs on a schedule
isVisiblebooleanWhether the search appears in the visible saved search list
cronSchedulestringCron schedule for the search
nextScheduledTimestringTime the scheduler runs this search again
alertTypestringAlert condition type (e.g. always, custom, number of events)
dispatchEarliestTimestringEarliest time bound used when the search is dispatched
dispatchLatestTimestringLatest time bound used when the search is dispatched
totalnumberTotal number of entries matching the request, from the response paging envelope. Compare with offset to decide whether another page remains.
offsetnumberOffset of the first entry in this page, echoed from the response paging envelope

Get the configuration of a single Splunk saved search by name, including its SPL, schedule, and alert settings.

Input

ParameterTypeRequiredDescription
baseUrlstringYesSplunk management URL including the management port (e.g. https://splunk.example.com:8089\)
authTokenstringNoSplunk authentication token, sent as a bearer token. Preferred over a password.
usernamestringNoSplunk username, used for basic authentication when no token is supplied
passwordstringNoSplunk password, used for basic authentication when no token is supplied
ownerstringNoNamespace owner for /servicesNS requests (e.g. admin, or nobody for app-shared objects). Leave both this and the app empty to use the authenticated user context; set only one and the other becomes the - wildcard.
appstringNoNamespace app context for /servicesNS requests (e.g. search). Leave both this and the owner empty to use the authenticated user context; set only one and the other becomes the - wildcard.
namestringYesName of the saved search (e.g. Errors in the last 24 hours)

Output

ParameterTypeDescription
namestringSaved search name
idstringFully qualified REST URI of the saved search
authorstringOwner of the saved search
updatedstringLast update timestamp
searchstringThe SPL the saved search runs
qualifiedSearchstringThe exact search string the scheduler runs
descriptionstringSaved search description
disabledbooleanWhether the saved search is disabled
isScheduledbooleanWhether the search runs on a schedule
isVisiblebooleanWhether the search appears in the visible saved search list
cronSchedulestringCron schedule for the search
nextScheduledTimestringTime the scheduler runs this search again
alertTypestringAlert condition type (e.g. always, custom, number of events)
dispatchEarliestTimestringEarliest time bound used when the search is dispatched
dispatchLatestTimestringLatest time bound used when the search is dispatched

Run a Splunk saved search immediately and return the search ID (sid) of the dispatched job.

Input

ParameterTypeRequiredDescription
baseUrlstringYesSplunk management URL including the management port (e.g. https://splunk.example.com:8089\)
authTokenstringNoSplunk authentication token, sent as a bearer token. Preferred over a password.
usernamestringNoSplunk username, used for basic authentication when no token is supplied
passwordstringNoSplunk password, used for basic authentication when no token is supplied
ownerstringNoNamespace owner for /servicesNS requests (e.g. admin, or nobody for app-shared objects). Leave both this and the app empty to use the authenticated user context; set only one and the other becomes the - wildcard.
appstringNoNamespace app context for /servicesNS requests (e.g. search). Leave both this and the owner empty to use the authenticated user context; set only one and the other becomes the - wildcard.
namestringYesName of the saved search to run (e.g. Errors in the last 24 hours)
triggerActionsbooleanNoWhether to trigger the saved search alert actions on this run
dispatchEarliestTimestringNoOverride the earliest time bound for this run — relative (e.g. -24h) or absolute time
dispatchLatestTimestringNoOverride the latest time bound for this run — relative (e.g. now) or absolute time
dispatchMaxCountnumberNoMaximum number of results before the search is finalized (e.g. 10000)
dispatchMaxTimenumberNoMaximum number of seconds before the search is finalized (e.g. 300)
dispatchTtlnumberNoTime to live in seconds for the search artifacts when no actions are triggered (e.g. 600)
forceDispatchbooleanNoStart a new search even when another instance of this saved search is already running

Output

ParameterTypeDescription
sidstringSearch ID of the dispatched job, used to poll status and fetch results

Splunk List Fired Alerts

List the saved searches with currently triggered (unexpired) Splunk alerts and how many times each has fired.

Input

ParameterTypeRequiredDescription
baseUrlstringYesSplunk management URL including the management port (e.g. https://splunk.example.com:8089\)
authTokenstringNoSplunk authentication token, sent as a bearer token. Preferred over a password.
usernamestringNoSplunk username, used for basic authentication when no token is supplied
passwordstringNoSplunk password, used for basic authentication when no token is supplied
ownerstringNoNamespace owner for /servicesNS requests (e.g. admin, or nobody for app-shared objects). Leave both this and the app empty to use the authenticated user context; set only one and the other becomes the - wildcard.
appstringNoNamespace app context for /servicesNS requests (e.g. search). Leave both this and the owner empty to use the authenticated user context; set only one and the other becomes the - wildcard.
countnumberNoMaximum number of entries to return (e.g. 50). 0 returns all.
offsetnumberNoIndex of the first entry to return, for pagination

Output

ParameterTypeDescription
alertsarraySaved searches with currently triggered alerts
namestringName of the alerting saved search
idstringFully qualified REST URI of the entry
updatedstringLast update timestamp
triggeredAlertCountnumberTrigger count for this alert
totalnumberTotal number of entries matching the request, from the response paging envelope. Compare with offset to decide whether another page remains.
offsetnumberOffset of the first entry in this page, echoed from the response paging envelope

Splunk Get Fired Alerts

List the unexpired triggered instances of a Splunk alert by saved search name, including severity, trigger time, and the search ID of each firing.

Input

ParameterTypeRequiredDescription
baseUrlstringYesSplunk management URL including the management port (e.g. https://splunk.example.com:8089\)
authTokenstringNoSplunk authentication token, sent as a bearer token. Preferred over a password.
usernamestringNoSplunk username, used for basic authentication when no token is supplied
passwordstringNoSplunk password, used for basic authentication when no token is supplied
ownerstringNoNamespace owner for /servicesNS requests (e.g. admin, or nobody for app-shared objects). Leave both this and the app empty to use the authenticated user context; set only one and the other becomes the - wildcard.
appstringNoNamespace app context for /servicesNS requests (e.g. search). Leave both this and the owner empty to use the authenticated user context; set only one and the other becomes the - wildcard.
namestringYesName of the alerting saved search (e.g. Errors in the last 24 hours). Use - to return the fired alerts of every saved search — this endpoint documents "Request parameters: None", so there is no count or offset to bound that with. Name one saved search unless you really want all of them.

Output

ParameterTypeDescription
firedAlertsarrayUnexpired triggered instances of the alert
namestringName of the fired alert entry
idstringFully qualified REST URI of the entry
updatedstringLast update timestamp
savedSearchNamestringName of the saved search that triggered the alert
alertTypestringWhether the alert was historical or real-time
severitynumberSeverity level of the alert
sidstringSearch ID of the search that triggered the alert
triggerTimenumberTime the alert was triggered
triggerTimeRenderedstringHuman-readable time the alert was triggered
expirationTimeRenderedstringHuman-readable time this triggered alert record expires
triggeredAlertsnumberNumber of alerts included in this triggered instance
actionsstringAdditional alert actions triggered by this alert

Splunk List Indexes

List the indexes configured on the Splunk instance with their size, event count, and retention settings.

Input

ParameterTypeRequiredDescription
baseUrlstringYesSplunk management URL including the management port (e.g. https://splunk.example.com:8089\)
authTokenstringNoSplunk authentication token, sent as a bearer token. Preferred over a password.
usernamestringNoSplunk username, used for basic authentication when no token is supplied
passwordstringNoSplunk password, used for basic authentication when no token is supplied
ownerstringNoNamespace owner for /servicesNS requests (e.g. admin, or nobody for app-shared objects). Leave both this and the app empty to use the authenticated user context; set only one and the other becomes the - wildcard.
appstringNoNamespace app context for /servicesNS requests (e.g. search). Leave both this and the owner empty to use the authenticated user context; set only one and the other becomes the - wildcard.
datatypestringNoFilter indexes by type: all, event, or metric. Splunk defaults to event, so pass all to include metric indexes.
countnumberNoMaximum number of indexes to return (e.g. 50). 0 returns all.
offsetnumberNoIndex of the first entry to return, for pagination

Output

ParameterTypeDescription
indexesarrayIndexes configured on the instance
namestringIndex name
idstringFully qualified REST URI of the index
updatedstringLast update timestamp
datatypestringIndex data type (event or metric)
disabledbooleanWhether the index is disabled
isInternalbooleanWhether this is an internal Splunk index
totalEventCountnumberTotal number of events in the index
currentDBSizeMBnumberCurrent index size in megabytes
maxTotalDataSizeMBnumberMaximum index size in megabytes before rolling to frozen
frozenTimePeriodInSecsnumberAge in seconds at which data rolls to frozen
minTimestringTimestamp of the earliest event in the index
maxTimestringTimestamp of the latest event in the index
homePathstringPath to the hot and warm buckets
coldPathstringPath to the cold buckets
thawedPathstringPath to the thawed buckets
totalnumberTotal number of entries matching the request, from the response paging envelope. Compare with offset to decide whether another page remains.
offsetnumberOffset of the first entry in this page, echoed from the response paging envelope

Splunk List Apps

List the apps installed on the Splunk instance with their label, version, author, and enabled state.

Input

ParameterTypeRequiredDescription
baseUrlstringYesSplunk management URL including the management port (e.g. https://splunk.example.com:8089\)
authTokenstringNoSplunk authentication token, sent as a bearer token. Preferred over a password.
usernamestringNoSplunk username, used for basic authentication when no token is supplied
passwordstringNoSplunk password, used for basic authentication when no token is supplied
ownerstringNoNamespace owner for /servicesNS requests (e.g. admin, or nobody for app-shared objects). Leave both this and the app empty to use the authenticated user context; set only one and the other becomes the - wildcard.
appstringNoNamespace app context for /servicesNS requests (e.g. search). Leave both this and the owner empty to use the authenticated user context; set only one and the other becomes the - wildcard.
countnumberNoMaximum number of apps to return (e.g. 50). 0 returns all.
offsetnumberNoIndex of the first app to return, for pagination

Output

ParameterTypeDescription
appsarrayApps installed on the Splunk instance
namestringApp directory name, usable as the app namespace
idstringFully qualified REST URI of the app
updatedstringLast update timestamp
labelstringDisplay name of the app
versionstringApp version
authorstringApp author
descriptionstringApp description
detailsstringURL with detailed information about the app
disabledbooleanWhether the app is disabled
visiblebooleanWhether the app is visible and navigable from Splunk Web
configuredbooleanWhether the custom app setup has been completed
checkForUpdatesbooleanWhether Splunkbase is checked for app updates
stateChangeRequiresRestartbooleanWhether changing the app state requires a restart
totalnumberTotal number of entries matching the request, from the response paging envelope. Compare with offset to decide whether another page remains.
offsetnumberOffset of the first entry in this page, echoed from the response paging envelope

On this page