Operate Splunk Enterprise, Enterprise Security, and Splunk SOAR from a terminal, or give an AI agent the same commands through MCP.
Requires Python 3.12+ and credentials for your Splunk instance.
python -m pip install splunkctl
splunkctl config init
splunkctl doctorDocumentation · Installation requirements
-
Investigate: run SPL, read fired alerts, and triage Enterprise Security notables. Search, Triage notables
-
Deploy detections: export saved searches to YAML, review the diff, and import them on another instance. Manage detection rules
-
Respond with SOAR: work containers, artifacts, vault files, notes, and playbook runs. Work SOAR incidents
-
Review configuration drift: pull live state, diff it against version control, and push approved changes with a change report. Manage configuration as code
-
Inspect object ACLs and preview ownership, sharing and role changes. Permissions
-
Diagnose ingestion queues, indexer status, disk space and runtime logging. Server introspection
-
Register project MCP servers for Claude, Codex, Cursor and Gemini. MCP clients
Every command that changes a remote Splunk or SOAR instance is guarded. Without --yes it prints a preview and exits without changing anything; some previews read the current state first to show a diff. The preview names the target host, and the active profile for Splunk Enterprise, so a change aimed at production is visible before it happens:
$ splunkctl --profile uat rules delete 'My Rule'
[DRY RUN] Delete saved search 'My Rule' (profile: uat @ uat.splunk.internal:8089)
Pass --yes to apply.
Add --yes to apply. splunkctl state push --report FILE writes a change report with the before and after state for each object, which you can attach to a change ticket.
--read-only guarantees no application-data, configuration or authentication changes on any server. Search jobs and server audit/access logs are exceptions. Guarded previews still work; --yes mutations are refused. Local files may change. See Read-only access and Raw REST API.
Local configuration writes are not guarded: splunkctl config init, splunkctl config use, splunkctl auth login, and splunkctl mcp install write to your own machine immediately. Use mcp install --preview to inspect registration changes without writing.
The MCP server exposes the command tree to Claude Code, Claude Desktop, Cursor, or any other MCP client. Setup, transports, and the progressive tool-loading model are in the MCP guide.
splunkctl mcp install # register the server in ./.mcp.json
splunkctl commands --json # machine-readable command treesplunkctl mcp serve --read-only (or SPLUNKCTL_READ_ONLY=1) hides mutation tools and enforces read-only policy in every CLI subprocess.
Guarded tools keep the same contract as the CLI: a call previews until the agent passes yes=true explicitly.
- Python 3.12 or newer.
- A Splunk account with REST API access on port 8089 (or your configured port). Each command needs the Splunk capability or SOAR permission its action requires;
splunkctl doctorreports which checks pass for the active profile. - Enterprise Security commands (
splunkctl es ...) check for theSplunkEnterpriseSecuritySuiteapp and exit 1 with anot_founderror when it is not installed. - Browser SAML login needs the
browserextra:python -m pip install 'splunkctl[browser]'.
splunkctl is an independent community project. It is not affiliated with or endorsed by Splunk Inc.
Splunk Inc. publishes an unrelated Go CLI with the same executable name, splunk/splunkctl. This package also installs splunkctl-py and leaves a Splunk-format config file untouched, so both tools can be installed together; see Relationship to Splunk's splunkctl.
- Releases and changelog
- Issues for bugs and feature requests; see SECURITY.md for vulnerabilities
- CONTRIBUTING.md for development setup
- License: Apache-2.0