Use the Splunk CLI from KosmoKrator to call Splunk tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.
Splunk can be configured headlessly with `kosmokrator integrations:configure splunk`.
# Install KosmoKrator first if it is not available on PATH.curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash# Configure and verify this integration.kosmokrator integrations:configure splunk --set access_token="$SPLUNK_ACCESS_TOKEN" --enable --read allow --write ask --jsonkosmokrator integrations:doctor splunk --jsonkosmokrator integrations:status --json
Credentials
Authentication type: Bearer tokenbearer_token. Configure credentials once, then use the same stored profile from
scripts, coding CLIs, Lua code mode, and the MCP gateway.
Key
Env var
Type
Required
Label
access_token
SPLUNK_ACCESS_TOKEN
Secret secret
yes
Access Token
url
SPLUNK_URL
URL url
no
Splunk URL
Call Splunk Headlessly
Use the generic call form when another coding CLI or script needs a stable universal interface.
Every function below can be called headlessly. The generic form is stable across all integrations;
the provider shortcut is shorter but specific to Splunk.
splunk.splunk_search
Write write
Run a Splunk search query (SPL). Creates an asynchronous search job and returns the search ID (SID). Use splunk_get_search_results to retrieve results once the job completes.
Retrieve results from a completed Splunk search job. Pass the search ID (SID) returned by splunk_search. Supports pagination with offset and count parameters.
Use these parameter tables when building CLI payloads without calling integrations:schema first.
splunk.splunk_search
Run a Splunk search query (SPL). Creates an asynchronous search job and returns the search ID (SID). Use splunk_get_search_results to retrieve results once the job completes.
The SPL search query (e.g., "search index=main error | head 100").
earliest_time
string
no
Earliest time for the search time range. Supports relative (e.g., "-24h", "-7d") or absolute (e.g., "2025-01-01T00:00:00") format.
latest_time
string
no
Latest time for the search time range. Supports relative (e.g., "now") or absolute (e.g., "2025-01-31T23:59:59") format.
splunk.splunk_get_search_results
Retrieve results from a completed Splunk search job. Pass the search ID (SID) returned by splunk_search. Supports pagination with offset and count parameters.
Headless calls still follow the integration read/write permission policy. Configure read/write defaults
with integrations:configure. Add --force only for trusted automation that should bypass that policy.