Run Splunk Search
run_splunk_searchExecute Splunk searches as tracked jobs with progress and stats. Use for complex or long-running queries needing job status, counts, and reliable result retrieval beyond 30 seconds.
Instructions
Run a Splunk search as a tracked job with progress and stats. Use this for complex or long‑running queries (joins, transforms, large scans) where you need job status, scan/event counts, and reliable result retrieval. Prefer this over oneshot when the query may exceed ~30s or requires progress visibility.
Waits up to MCP_SEARCH_WAIT_SECONDS (default 15) then returns job_id even if the job is still running. If is_done is false, poll get_search_job_info, then get_search_job_results. If has_more is true after completion, page with offset=next_offset. count/max_results of 0 is treated as the default page size (50), max 100. Security: results are constrained by the authenticated user's permissions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | ||
| query | Yes | The Splunk search query (SPL) to execute. Can be any valid SPL command or pipeline. Supports complex searches with transforming commands, joins, and subsearches. Examples: 'index=* | stats count by sourcetype', 'search error | eval severity=case(...)' earliest_time (str, optional): Search start time in Splunk time format. Examples: '-24h', '-7d@d', '2023-01-01T00:00:00' Default: '-24h' latest_time (str, optional): Search end time in Splunk time format. Examples: 'now', '-1h', '@d', '2023-01-01T23:59:59' Default: 'now' count (int, optional): Page size 1-100 (default 50; 0 uses default) | |
| offset | No | Result offset (default 0) | |
| latest_time | No | now | |
| max_results | No | Deprecated alias for count | |
| earliest_time | No | -24h |