Skip to main content

CLI tool for Splunk Enterprise SIEM operations.

Project description

splunkctl

CLI tool for Splunk Enterprise SIEM operations.

Query, inspect, and manage a remote Splunk Enterprise instance from your laptop. Built on the splunk-sdk-python fork with Click.

Install

pip install splunkctl
pip install git+https://github.com/dannyota/splunk-sdk-python@splunkctl

Requires Python 3.13+. The second line installs the forked SDK which adds dashboard, lookup, and HEC token support. Without it, core commands (search, rules, alerts, indexes, inputs, apps, users) still work.

Development

git clone https://github.com/dannyota/splunkctl
cd splunkctl
pip install -e .
splunkctl --version

Quick start

splunkctl config init                         # interactive setup
splunkctl doctor                              # check connection, auth, permissions
splunkctl search run 'index=main | head 10'   # run a search
splunkctl rules list                          # list detection rules

Commands

Group Description
doctor Connection, auth, health, and permissions check
config Setup, show config, test connectivity
info Server info (version, OS, license)
search Run, export, oneshot, upload, job management
rules Detection rules — CRUD, import/export (YAML)
alerts Fired alerts, alert actions, suppression
dashboards Dashboard CRUD (XML)
indexes Index management
inputs Data inputs (monitor, tcp, udp, script, http)
lookups Lookup table CRUD (CSV, mmdb)
hec HEC token management
parsers Source types and field extractions
apps App install (.spl/.tar.gz), uninstall, update
users User and role management
commands Machine-readable command tree (JSON)
skill Embedded agent operating guide

Key features

Detection-as-code

Export existing rules to YAML, version control them, deploy across instances:

splunkctl rules export --path detections.yml
splunkctl rules import --path detections.yml        # dry-run preview
splunkctl --yes rules import --path detections.yml  # apply

Remote file operations

Upload files from your laptop without SSH access to the server:

# Upload threat intel, logs, or sample data for indexing
splunkctl --yes search upload --path threats.csv --index threat_intel --sourcetype csv

# Upload lookup tables (CSV or GeoIP mmdb)
splunkctl --yes lookups upload --name threats.csv --path threats.csv

# Install apps from local .spl/.tar.gz packages
splunkctl --yes apps install --path TA_windows.spl

Diagnostics

splunkctl doctor             # check everything: connection, auth, health, permissions
splunkctl doctor --json      # machine-readable output

Global flags

--json              Force JSON output
--format FMT        Output format: table, json, csv, jsonl
--fields f1,f2      Project specific fields
--out FILE          Write output to file
--yes / -y          Apply mutations (skip dry-run preview)
--timeout N         Request timeout in seconds (default 30)
--config FILE       Config file path
--debug             HTTP request/response logging

Dry-run by default

All write operations preview what would change. Pass --yes to apply.

splunkctl rules delete 'My Rule'          # shows preview only
splunkctl rules delete 'My Rule' --yes    # actually deletes

Output formats

splunkctl rules list                      # table (TTY) or JSON (pipe)
splunkctl rules list --json               # force JSON
splunkctl rules list --format csv         # CSV
splunkctl rules list --fields name,cron   # project fields
splunkctl rules list --out rules.json     # write to file

SDK fork

splunkctl depends on a fork of splunk-sdk-python that adds entity classes missing from the upstream SDK:

Entity Service property Purpose
Dashboard service.dashboards Dashboard CRUD
LookupTableFile service.lookup_table_files Lookup table metadata + download
HECToken service.hec_tokens HEC token management

Install the fork directly:

pip install git+https://github.com/dannyota/splunk-sdk-python@splunkctl

Agent integration

splunkctl ships with an embedded operating guide for AI agents (Claude Code, etc.):

splunkctl skill                           # print the guide
splunkctl skill install                   # install to ~/.claude/skills/
splunkctl commands                        # JSON command tree for discovery

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

splunkctl-0.3.0.tar.gz (52.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

splunkctl-0.3.0-py3-none-any.whl (60.7 kB view details)

Uploaded Python 3

File details

Details for the file splunkctl-0.3.0.tar.gz.

File metadata

  • Download URL: splunkctl-0.3.0.tar.gz
  • Upload date:
  • Size: 52.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for splunkctl-0.3.0.tar.gz
Algorithm Hash digest
SHA256 c5821ecf3e9148780a34f6ff9dc4218a4e3017848f818b6785530b382befea94
MD5 c0c3dba48f5b8c2020113d12da813c1d
BLAKE2b-256 71f654d411a0db3f77ffbe9c673897d6fca9e3b77777b5b1c6af84432e8d3611

See more details on using hashes here.

Provenance

The following attestation bundles were made for splunkctl-0.3.0.tar.gz:

Publisher: publish.yml on dannyota/splunkctl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file splunkctl-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: splunkctl-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 60.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for splunkctl-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ab311370a92eb3b53767c23b0f7adfd0eab3c377421aa17386b9f9a28e2c0193
MD5 f02a105b9d90193d91c3994763ad1599
BLAKE2b-256 2dd08cf650f2540ee46d447fd6762ac8a61e417bbd5a1eaf0e54ad37ce8be30f

See more details on using hashes here.

Provenance

The following attestation bundles were made for splunkctl-0.3.0-py3-none-any.whl:

Publisher: publish.yml on dannyota/splunkctl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page