
splunk-assistant-skills
Complete Splunk automation suite with 14 specialized skills - search execution, job lifecycle, data export, metadata discovery, lookups, saved searches, alerts, and more
- version
- 2.0.0
- GitHub stars
- 17
Install
/plugin install splunk-assistant-skills@splunk-assistant-skillsRun it inside Claude Code after adding the marketplace with /plugin marketplace add grandcamel/Splunk-Assistant-Skills.
Contents
Discovered from sourceSkills 14
splunk-alert
Alert triggering, monitoring, and notification management for Splunk.
Purpose
Create and manage alerts, monitor triggered alerts, and configure alert actions.
Risk Levels
| Operation | Risk | Notes |
|---|---|---|
| List alerts | - | Read-only |
| Get alert details | - | Read-only |
| List triggered alerts | - | Read-only |
| Create alert | ⚠️ | May trigger notifications |
| Update alert | ⚠️ | Previous config lost |
| Acknowledge alert | ⚠️ | Can be re-triggered |
| Delete alert | ⚠️⚠️ | May be recoverable from backup |
Triggers
- "alert", "trigger", "notification"
- "monitor", "alerting"
CLI Commands
| Command | Description |
|---|---|
alert create | Create a new alert |
alert get | Get alert details |
alert list | List all alerts (scheduled searches with alert actions) |
alert triggered | List triggered alerts |
alert acknowledge | Acknowledge a triggered alert |
Examples
# Create an alert
splunk-as alert create --name "High Error Rate" \
--search "index=main sourcetype=app_logs error | stats count" \
--condition "number of events" \
--comparator "greater than" \
--threshold 100 \
--cron "*/5 * * * *" \
--actions email \
--email-to ops@example.com
# List all configured alerts
splunk-as alert list --app search --count 100
# Get specific alert details
splunk-as alert get "High Error Rate"
# List triggered alert instances with filters
splunk-as alert triggered --app search --count 20
# Acknowledge/delete a triggered alert
splunk-as alert acknowledge alert_12345
Alert Configuration
Severity Levels
- 1 = debug
- 2 = info
- 3 = warn (default)
- 4 = error
- 5 = severe
- 6 = fatal
Alert Types
always- Trigger on every scheduled executionnumber of events- Trigger when result count meets conditionnumber of hosts- Trigger when host count meets conditionnumber of sources- Trigger when source count meets conditioncustom- Custom alert condition
Alert Comparators
greater thanless thanequal tonot equal todrops byrises by
Alert Actions
email- Send email notificationwebhook- HTTP POST to webhook URLscript- Execute custom script- Custom actions configured in Splunk
API Endpoints
GET /services/alerts/fired_alerts- List triggered alertsGET /services/alerts/fired_alerts/{name}- Get specific triggered alertDELETE /services/alerts/fired_alerts/{name}- Acknowledge/delete triggered alertPOST /servicesNS/nobody/{app}/saved/searches- Create alert (via saved search)GET /servicesNS/nobody/{app}/saved/searches- List alert configurations
splunk-app
Splunk application management.
Purpose
Install, uninstall, enable, disable, and manage Splunk applications.
Risk Levels
| Operation | Risk | Notes |
|---|---|---|
| List apps | - | Read-only |
| Get app details | - | Read-only |
| Enable app | ⚠️ | Easily reversible |
| Disable app | ⚠️ | Easily reversible |
| Install app | ⚠️⚠️ | May affect system behavior |
| Uninstall app | ⚠️⚠️⚠️ | IRREVERSIBLE - app files deleted |
Triggers
- "app", "application", "install"
- "package", "addon"
CLI Commands
| Command | Description |
|---|---|
app list | List installed apps |
app get <name> | Get app details |
app install <file> | Install app from package file (.tar.gz, .tgz, .spl) |
app uninstall <name> | Remove app |
app enable <name> | Enable disabled app |
app disable <name> | Disable app |
Options
| Option | Commands | Description |
|---|---|---|
-o, --output | list, get | Output format (text, json) |
-n, --name | install | App name (overrides name from package) |
--update/--no-update | install | Update if app exists |
-f, --force | uninstall | Skip confirmation |
Examples
# List installed apps
splunk-as app list
splunk-as app list -o json
# Get app details
splunk-as app get search
splunk-as app get search --output json
# Install app (supports .tar.gz, .tgz, .spl formats)
splunk-as app install my_app.tgz
splunk-as app install my_app.spl --update
splunk-as app install package.tar.gz --name custom_app_name
# Uninstall app
splunk-as app uninstall my_app
splunk-as app uninstall my_app --force
# Enable app
splunk-as app enable my_app
# Disable app
splunk-as app disable my_app
API Endpoints
GET/POST /services/apps/local- List/InstallGET/POST/DELETE /services/apps/local/{name}- CRUDPOST /services/apps/local/{name}/package- Export
splunk-assistant
Central hub and router for Splunk Assistant Skills. Routes requests to 17 CLI command groups using 3-level progressive disclosure.
Purpose
Routes natural language requests to specialized Splunk skills based on intent. Provides connection verification, authentication validation, and execution strategy recommendations.
Risk Levels
| Operation | Risk | Notes |
|---|---|---|
| Get server info | - | Read-only |
| Verify connection | - | Read-only |
| Route to skill | - | Navigation only |
Triggers
- Any Splunk-related request
- "splunk", "search", "query", "SPL"
- Connection/authentication issues
- General Splunk questions
Progressive Disclosure
Level 1: Essential Connection & Identification
- Verify Search Head connection on management port 8089 via HTTPS
- Validate JWT Bearer token or Basic Auth credentials
- Detect deployment type (Cloud vs on-prem)
- Route to appropriate specialized skill
Level 2: Execution Mode Strategy
| Mode | Use Case | Characteristics |
|---|---|---|
| Oneshot | Ad-hoc queries | Results inline, no SID, minimal disk I/O |
| Normal | Long searches | Returns SID, poll for results, progress tracking |
| Blocking | Simple queries | Waits for completion, synchronous |
| Export | Large extracts | Streaming, checkpoint support, ETL |
Level 3: Advanced Optimization & Resource Governance
- Time Modifiers: Always enforce
earliest_timeandlatest_time - Field Reduction: Insert
fieldscommand to limit data transfer - Resource Cleanup: Issue
/control/cancelafter results consumed - Error Handling: Use
strict=truefor clear errors vs incomplete data
CLI Command Groups
| CLI Command | Skill | Description |
|---|---|---|
search | splunk-search | Execute SPL query |
job | splunk-job | Job lifecycle management |
export | splunk-export | Large data export |
metadata | splunk-metadata | Index/source discovery |
lookup | splunk-lookup | Lookup management |
tag | splunk-tag | Tag operations |
savedsearch | splunk-savedsearch | Saved searches/reports |
alert | splunk-alert | Alert management |
admin | splunk-rest-admin | REST/Server administration |
security | splunk-security | Token/RBAC/ACL |
metrics | splunk-metrics | Metrics (mstats) |
app | splunk-app | App management |
kvstore | splunk-kvstore | KV Store |
dashboard | - | Dashboard management |
input | - | Data input management |
user | - | User management |
config | - | Configuration management |
completion | - | Shell completion (utility) |
Connection Verification
# Get server information (verify connection)
splunk-as admin info
# Get server status
splunk-as admin status
# Get server health status
splunk-as admin health
Examples
Verify Connection
splunk-as admin info
# Output:
# ✓ Connected to splunk.example.com:8089
# ✓ Authentication: Bearer token valid
# ✓ Deployment: Splunk Enterprise 9.1.0
# ✓ User: admin (capabilities: search, admin_all_objects)
Get Server Info
splunk-as admin info --output json
# Output: Server version, build, OS, cluster status, etc.
Common CLI Commands
# Search commands
splunk-as search oneshot "index=main | head 10"
splunk-as search normal "index=main | stats count" --wait
# Job management
splunk-as job list
splunk-as job status 1703779200.12345
# Metadata discovery
splunk-as metadata indexes
splunk-as metadata sourcetypes --index main
# Security
splunk-as security whoami
Best Practices
- Always include time bounds - Prevent full index scans
- Use field extraction - Limit data transfer
- Choose appropriate mode - Oneshot for ad-hoc, Export for ETL
- Clean up resources - Cancel jobs when done
- Handle errors gracefully - Use the error hierarchy
Related Skills
- splunk-job - Job lifecycle
- splunk-search - Query execution
- splunk-security - Authentication
splunk-export
High-volume streaming data extraction for Splunk.
Purpose
Export large result sets (>50,000 rows) efficiently using streaming.
Risk Levels
| Operation | Risk | Notes |
|---|---|---|
| Export results | - | Read-only |
| Export from job | - | Read-only |
| Estimate size | - | Read-only |
Triggers
- "export", "download", "extract"
- "stream", "large results", "ETL"
- "backup", "archive"
CLI Commands
| Command | Description |
|---|---|
export estimate | Estimate export size |
export job | Export from existing job |
export results | Export results to file |
export stream | Stream large exports efficiently |
Options
| Option | Commands | Description |
|---|---|---|
-o, --output-file | job, results, stream | Output file path (required) |
-f, --format | job, results, stream | Export format (csv, json, json_rows, xml) |
-e, --earliest | estimate, results, stream | Earliest time |
-l, --latest | estimate, results, stream | Latest time |
-c, --count | job, stream | Maximum results to export |
--fields | results, stream | Comma-separated fields to export |
--progress | results | Show progress |
Examples
Export Results
# Export to CSV (using short flags)
splunk-as export results "index=main | head 1000" -o results.csv
# Export to JSON with specific fields
splunk-as export results "index=main" -o data.json -f json --fields host,status
# Export with progress indicator
splunk-as export results "index=main | stats count by host" -o report.csv --progress
Export from Existing Job
# Export results from a completed search job
splunk-as export job 1703779200.12345 -o job_results.csv
# Export with count limit
splunk-as export job 1703779200.12345 -o results.csv -c 10000
# Export as JSON array (json_rows format)
splunk-as export job 1703779200.12345 -o data.json -f json_rows
Stream Export
# Stream large export efficiently
splunk-as export stream "index=main | head 1000000" -o large_results.csv
# Stream with count limit
splunk-as export stream "index=main" -o results.csv -c 50000
# Stream with specific fields
splunk-as export stream "index=main" -o data.json -f json_rows --fields host,status
Estimate Size
# Preview count before export
splunk-as export estimate "index=main | stats count by host" -e -7d
# Output: Estimated 1,234,567 results
API Endpoints
| Endpoint | Description |
|---|---|
GET /services/search/v2/jobs/{sid}/results | Stream results |
GET /services/search/v2/jobs/{sid}/events | Stream raw events |
Parameters
| Parameter | Description |
|---|---|
count=0 | Return all results (no limit) |
output_mode | csv, json, xml, raw |
field_list | Comma-separated fields |
Best Practices
- Use streaming for >50K results
- Estimate size first before large exports
- Limit fields to reduce data transfer
- Monitor progress for long-running exports
- Compress output for storage efficiency
Related Skills
- splunk-search - Query execution
- splunk-job - Job management
splunk-job
Search job lifecycle orchestration for Splunk.
Purpose
Manage the complete lifecycle of Splunk search jobs including creation, monitoring, control actions (pause/cancel/finalize), and cleanup.
Risk Levels
| Operation | Risk | Notes |
|---|---|---|
| Get job status | - | Read-only |
| List jobs | - | Read-only |
| Create job | - | Easily reversible via cancel |
| Pause/unpause job | ⚠️ | Can be undone |
| Finalize job | ⚠️ | Returns partial results |
| Cancel job | ⚠️ | Stops execution |
| Delete job | ⚠️⚠️ | Removes job and results |
Triggers
- "job", "search job", "SID"
- "status", "progress", "state"
- "cancel", "pause", "unpause", "finalize"
- "list jobs", "delete job"
Job States (dispatchState)
QUEUED → PARSING → RUNNING → FINALIZING → DONE
→ FAILED
→ PAUSED (on pause action)
| State | Description |
|---|---|
| QUEUED | Job waiting in queue |
| PARSING | SPL being parsed |
| RUNNING | Search executing |
| FINALIZING | Results being finalized |
| DONE | Completed successfully |
| FAILED | Error occurred |
| PAUSED | Paused by user |
CLI Commands
| Command | Description |
|---|---|
job create | Create search job, return SID |
job status | Get dispatchState, progress, stats |
job poll | Wait for job completion with timeout |
job cancel | Issue /control/cancel action |
job pause | Issue /control/pause action |
job unpause | Issue /control/unpause action |
job finalize | Issue /control/finalize action |
job ttl | Set job time-to-live |
job touch | Touch a job to extend its TTL |
job list | List all search jobs for user |
job delete | Remove job from dispatch directory |
Examples
Create and Monitor Job
# Create job
splunk-as job create "index=main | stats count by sourcetype" --earliest -1h
# Output: Job created: 1703779200.12345
# Check status
splunk-as job status 1703779200.12345
# Output: State: RUNNING, Progress: 45%, Events: 12345
# Wait for completion
splunk-as job poll 1703779200.12345 --timeout 300
# Output: Job completed: DONE, Results: 42
Job Control
# Pause running job
splunk-as job pause 1703779200.12345
# Resume paused job
splunk-as job unpause 1703779200.12345
# Cancel job
splunk-as job cancel 1703779200.12345
# Finalize (stop and return current results)
splunk-as job finalize 1703779200.12345
Job Management
# List all jobs
splunk-as job list
# Output: Table of active jobs with status
# Extend TTL (positional arg: SID TTL_VALUE)
splunk-as job ttl 1703779200.12345 3600
# Delete job
splunk-as job delete 1703779200.12345
API Endpoints
| Endpoint | Method | Description |
|---|---|---|
/services/search/v2/jobs | POST | Create job |
/services/search/v2/jobs/{sid} | GET | Get job status |
/services/search/v2/jobs/{sid}/control | POST | Control actions |
/services/search/jobs | GET | List jobs |
/services/search/jobs/{sid} | DELETE | Delete job |
Control Actions
# Available actions for /control endpoint
actions = ['cancel', 'pause', 'unpause', 'finalize', 'touch', 'setttl', 'enablepreview', 'disablepreview']
# POST /services/search/v2/jobs/{sid}/control
# data={'action': 'cancel'}
Job Properties
| Property | Description |
|---|---|
sid | Search job ID |
dispatchState | Current state |
doneProgress | Completion 0.0-1.0 |
eventCount | Events scanned |
resultCount | Results produced |
scanCount | Buckets scanned |
runDuration | Execution time |
ttl | Time to live |
isFailed | Failure flag |
isPaused | Pause flag |
Best Practices
- Always set time bounds in the search query
- Use appropriate timeout for poll_job.py
- Cancel jobs when results are no longer needed
- Monitor progress for long-running searches
- Extend TTL for jobs you need to keep
Related Skills
- splunk-search - Query execution
- splunk-export - Result extraction
splunk-kvstore
Interaction with App Key Value Store for persistent metadata.
Purpose
Create and manage KV store collections and records for persistent data storage.
Risk Levels
| Operation | Risk | Notes |
|---|---|---|
| List collections | - | Read-only |
| Get record | - | Read-only |
| Query collection | - | Read-only |
| Insert record | ⚠️ | Easily reversible |
| Create collection | ⚠️ | Easily reversible |
| Update record | ⚠️ | Previous value lost |
| Delete record | ⚠️⚠️ | Data loss, may be in backups |
| Delete collection | ⚠️⚠️⚠️ | IRREVERSIBLE - all data lost |
Triggers
- "kvstore", "collection", "key-value"
- "persist", "store"
CLI Commands
| Command | Description |
|---|---|
kvstore list | List collections in app |
kvstore create <name> | Create KV store collection |
kvstore delete <name> | Delete collection (IRREVERSIBLE) |
kvstore truncate <collection> | Delete all records in collection |
kvstore insert <collection> | Insert record into collection |
kvstore batch-insert <collection> | Insert multiple records at once |
kvstore get <collection> <key> | Get record by _key |
kvstore update <collection> <key> | Update existing record |
kvstore delete-record <collection> <key> | Delete individual record by _key |
kvstore query <collection> | Query with filters |
Examples
# Show help
splunk-as kvstore --help
# List collections
splunk-as kvstore list --app search
# Create collection
splunk-as kvstore create my_collection --app search
# Insert record
splunk-as kvstore insert my_collection '{"name": "test", "value": 123}' --app search
# Get record by _key
splunk-as kvstore get my_collection abc123 --app search
# Query collection with filters
splunk-as kvstore query my_collection --query '{"name": "test"}' --app search
# Update record by _key
splunk-as kvstore update my_collection abc123 '{"name": "updated"}' --app search
# Delete individual record by _key (use delete-record, not delete)
splunk-as kvstore delete-record my_collection abc123 --app search
# Truncate collection (delete all records, keep collection)
splunk-as kvstore truncate my_collection --app search
# Batch insert multiple records from JSON file
splunk-as kvstore batch-insert my_collection records.json --app search
# Delete collection (IRREVERSIBLE - removes collection and all records)
splunk-as kvstore delete my_collection --app search --force
Command Terminology
| Command | Target | Description |
|---|---|---|
delete-record | Single record | Deletes one record by its _key |
delete | Collection | Deletes entire collection and all records (IRREVERSIBLE) |
API Endpoints
GET/POST/DELETE /services/storage/collections/config- CollectionsGET/POST /services/storage/collections/data/{collection}- RecordsGET/PUT/DELETE /services/storage/collections/data/{collection}/{key}- Record
SPL Patterns
| inputlookup collection_name
| outputlookup collection_name append=true
splunk-lookup
CSV and lookup file management for Splunk.
Purpose
Upload, download, and manage CSV lookup files and lookup definitions.
Risk Levels
| Operation | Risk | Notes |
|---|---|---|
| List lookups | - | Read-only |
| Get lookup info | - | Read-only |
| Download lookup | - | Read-only |
| Upload lookup | ⚠️ | Creates new or overwrites |
| Delete lookup | ⚠️⚠️ | May be recoverable from backup |
Triggers
- "lookup", "CSV", "upload"
- "lookup table", "enrichment"
CLI Commands
| Command | Description |
|---|---|
lookup list | List lookup files |
lookup get | Get contents of a lookup file |
lookup upload | Upload CSV lookup file |
lookup download | Download lookup file |
lookup delete | Remove lookup file |
lookup transforms | List lookup transforms/definitions |
Options
| Option | Commands | Description |
|---|---|---|
-a, --app | all | App context (defaults to "search" for most commands) |
-o, --output | list, get, transforms | Output format (text, json; get also supports csv) |
-c, --count | get | Maximum rows to show |
-n, --name | upload | Lookup name (defaults to filename) |
-f, --force | delete | Skip confirmation |
--output-file | download | Output file path |
App Context
The -a/--app option specifies the Splunk app context:
- Optional for listing: Filter results to a specific app
- Required for upload: Specifies where to store the lookup
- Recommended for get/download/delete: Ensures you target the correct lookup file
Default behavior varies by command. When multiple apps have lookups with the same name, always specify --app.
Examples
# List lookups (with output format)
splunk-as lookup list -a search
splunk-as lookup list -a search -o json
# Get lookup contents (with count limit)
splunk-as lookup get users.csv -a search
splunk-as lookup get users.csv -a search -c 100 -o csv
# Upload lookup (with custom name)
splunk-as lookup upload users.csv -a search
splunk-as lookup upload /path/to/data.csv -a search -n custom_lookup
# Download lookup
splunk-as lookup download users.csv --output-file ./users.csv
# Delete lookup (with force flag)
splunk-as lookup delete old_users.csv -a search
splunk-as lookup delete old_users.csv -a search -f
# List lookup transforms/definitions
splunk-as lookup transforms -a search
splunk-as lookup transforms -a search -o json
API Endpoints
POST /services/data/lookup-table-files- UploadGET /services/data/lookup-table-files- ListGET/DELETE /services/data/lookup-table-files/{name}- Get/Delete
splunk-metadata
Query index, source, and sourcetype configurations for Splunk.
Purpose
Discover and explore metadata about indexes, sources, sourcetypes, and fields.
Risk Levels
| Operation | Risk | Notes |
|---|---|---|
| List indexes | - | Read-only |
| Get index info | - | Read-only |
| List sources | - | Read-only |
| List sourcetypes | - | Read-only |
| Get field summary | - | Read-only |
| Metadata search | - | Read-only |
Triggers
- "metadata", "index", "source", "sourcetype"
- "fields", "discovery", "catalog"
CLI Commands
| Command | Description |
|---|---|
metadata indexes | List available indexes |
metadata index-info | Index size, event count, time range |
metadata sources | Unique sources per index |
metadata sourcetypes | Sourcetypes in use |
metadata search | Execute | metadata search (supports hosts, sources, sourcetypes) |
metadata fields | Field summary for index/sourcetype |
Options
| Option | Commands | Description |
|---|---|---|
-f, --filter | indexes | Filter indexes by name pattern |
-o, --output | indexes, sources, sourcetypes, search, fields | Output format (text, json) |
-i, --index | sources, sourcetypes, search | Filter by index |
-e, --earliest | search, fields | Earliest time |
-s, --sourcetype | fields | Filter by sourcetype |
Examples
# List all indexes (with filter and output options)
splunk-as metadata indexes
splunk-as metadata indexes -f "main*" -o json
# Get index details
splunk-as metadata index-info main
# List sourcetypes (with output format)
splunk-as metadata sourcetypes -i main
splunk-as metadata sourcetypes -i main -o json
# List sources
splunk-as metadata sources -i main
splunk-as metadata sources -i main -o json
# Field summary (with earliest time)
splunk-as metadata fields main -s access_combined
splunk-as metadata fields main -s access_combined -e -24h -o json
# Metadata search (with time range)
splunk-as metadata search sourcetypes -i main
splunk-as metadata search hosts -i main -e -7d
splunk-as metadata search sources -i main -o json
SPL Patterns
# Metadata command
| metadata type=sourcetypes index=main
# Metasearch
| metasearch index=* sourcetype=access_combined
# Field summary
| fieldsummary maxvals=100
Related Skills
- splunk-search - Query execution
splunk-metrics
Real-time metrics and data point analysis for Splunk.
Purpose
Query and analyze metrics data using mstats and mcatalog commands.
Risk Levels
| Operation | Risk | Notes |
|---|---|---|
| List metrics | - | Read-only |
| List metric indexes | - | Read-only |
| Query with mstats | - | Read-only |
| Discover with mcatalog | - | Read-only |
Triggers
- "metrics", "mstats", "mcatalog"
- "time series", "data points"
CLI Commands
| Command | Description |
|---|---|
metrics mstats | Execute mstats command |
metrics mcatalog | Query metrics catalog |
metrics mpreview | Preview metrics data |
metrics indexes | List metric indexes |
metrics list | List metric names |
Options
| Option | Commands | Description |
|---|---|---|
-i, --index | mstats, mcatalog, mpreview, list | Metrics index |
-o, --output | mcatalog, mpreview | Output format (text, json) |
-m, --metric | mcatalog | Filter by metric name pattern |
-f, --filter | mpreview | Filter expression (e.g., host=server1) |
-c, --count | mpreview | Number of data points |
--agg | mstats | Aggregation function |
--split-by | mstats | Split by field |
--span | mstats | Time span |
Examples
# List metrics
splunk-as metrics list -i metrics
# List metric indexes
splunk-as metrics indexes
# Query with mstats
splunk-as metrics mstats cpu.percent --agg avg --split-by host --span 1h
# Discover metrics with mcatalog (use -m/--metric for filtering)
splunk-as metrics mcatalog -i metrics -m "cpu.*"
splunk-as metrics mcatalog -i metrics -o json
# Preview metrics data (requires metric_name positional arg)
splunk-as metrics mpreview cpu.percent -i metrics
splunk-as metrics mpreview cpu.percent -i metrics -f "host=server1" -c 50
SPL Patterns
| mstats avg(cpu.percent) WHERE index=metrics BY host span=1h
| mcatalog values(metric_name) WHERE index=metrics
| mpreview index=metrics
splunk-rest-admin
Programmatic access to internal configurations via REST command.
Purpose
Query and manage Splunk server configurations, users, roles, and system info.
Risk Levels
| Operation | Risk | Notes |
|---|---|---|
| REST GET request | - | Read-only |
| Get server info | - | Read-only |
| List users/roles | - | Read-only |
| REST POST request | ⚠️⚠️ | May modify server config |
Triggers
- "rest", "admin", "config"
- "server", "settings", "info"
CLI Commands
| Command | Description |
|---|---|
admin info | Get server information |
admin status | Get server status |
admin health | Get server health |
admin list-users | List all users |
admin list-roles | List all roles |
admin rest-get | Make GET request to REST endpoint |
admin rest-post | Make POST request to REST endpoint |
REST Options
| Option | Description |
|---|---|
-d, --data | JSON data payload for POST requests |
-a, --app | App context for REST requests |
--owner | Owner context for REST requests |
-o, --output | Output format (text, json) |
Examples
# Get server info
splunk-as admin info
splunk-as admin info --output json
# Get server status
splunk-as admin status
splunk-as admin status --output json
# Get server health
splunk-as admin health
splunk-as admin health --output json
# List users
splunk-as admin list-users
# List roles
splunk-as admin list-roles
# REST GET request - users
splunk-as admin rest-get /services/authentication/users
# REST GET request - server info
splunk-as admin rest-get /services/server/info
# REST GET request - apps with app/owner context
splunk-as admin rest-get /services/apps/local --app search --owner admin
# REST POST request with app/owner context
splunk-as admin rest-post /services/saved/searches -d '{"name": "test"}' --app search --owner admin
SPL Patterns
| rest /services/server/info
| rest /services/authentication/users
| rest /services/admin/conf-times
splunk-savedsearch
CRUD for reports and scheduled searches in Splunk.
Purpose
Create, read, update, delete saved searches, reports, and scheduled searches.
Risk Levels
| Operation | Risk | Notes |
|---|---|---|
| List saved searches | - | Read-only |
| Get saved search | - | Read-only |
| Run saved search | - | Read-only execution |
| Create saved search | ⚠️ | Can be deleted |
| Update saved search | ⚠️ | Previous version lost |
| Enable/disable schedule | ⚠️ | Easily reversible |
| Delete saved search | ⚠️⚠️ | May be recoverable from backup |
Triggers
- "saved search", "report", "schedule"
- "scheduled search", "alert"
CLI Commands
Commands provided by the splunk-as package (pip install splunk-as):
| Command | Description |
|---|---|
savedsearch list | List saved searches in app |
savedsearch get | Get saved search details |
savedsearch create | Create saved search/report |
savedsearch update | Modify saved search |
savedsearch run | Execute saved search on-demand |
savedsearch history | Get saved search execution history |
savedsearch enable | Enable scheduled execution |
savedsearch disable | Disable scheduling |
savedsearch delete | Delete saved search |
Examples
# List saved searches
splunk-as savedsearch list --app search
# Get saved search details
splunk-as savedsearch get "My Report"
# Create saved search (use --name and --search options)
splunk-as savedsearch create --name "My Report" --search "index=main | stats count" --app search
# Update saved search
splunk-as savedsearch update "My Report" --search "index=main | stats count by host"
# Run saved search (--wait/--no-wait controls blocking)
splunk-as savedsearch run "My Report" --wait
splunk-as savedsearch run "My Report" --no-wait
# Get execution history (default shows 10 entries)
splunk-as savedsearch history "My Report"
splunk-as savedsearch history "My Report" -c 20
# Enable scheduling
splunk-as savedsearch enable "My Report"
# Disable scheduling
splunk-as savedsearch disable "My Report"
# Delete saved search
splunk-as savedsearch delete "My Report"
API Endpoints
GET/POST /services/saved/searches- CRUDPOST /services/saved/searches/{name}/dispatch- RunGET /services/saved/searches/{name}/history- History
splunk-search
SPL query execution in multiple modes for Splunk.
Purpose
Execute SPL (Search Processing Language) queries using various execution modes: oneshot (inline results), normal (async with polling), and blocking (sync wait).
Risk Levels
| Operation | Risk | Notes |
|---|---|---|
| Execute search (read) | - | Read-only query |
| Get results | - | Read-only |
| Validate SPL | - | Read-only |
| Execute search (write) | ⚠️⚠️ | SPL with ` |
Triggers
- "search", "SPL", "query", "find"
- "oneshot", "blocking", "async"
- "execute", "run search"
Search Modes
| Mode | Use Case | Returns SID | Wait for Results |
|---|---|---|---|
| Oneshot | Ad-hoc queries < 50K rows | No | Inline |
| Normal | Long-running searches | Yes | Async (poll) |
| Blocking | Simple queries | Yes | Sync (waits) |
CLI Commands
| Command | Description |
|---|---|
search oneshot | Execute oneshot search (results inline) |
search normal | Execute normal search (returns SID) |
search blocking | Execute blocking search (waits) |
search results | Get results from completed job |
search preview | Get partial results during search |
search validate | Validate SPL syntax |
Examples
Oneshot Search (Recommended for Ad-hoc)
# Simple search
splunk-as search oneshot "index=main | stats count by sourcetype"
# With time range
splunk-as search oneshot "index=main | head 100" --earliest -1h --latest now
# Output as JSON
splunk-as search oneshot "index=main | top host" --output json
# With count limit and specific fields
splunk-as search oneshot "index=main" --count 100 --fields host,status
# Output to file
splunk-as search oneshot "index=main | head 1000" --output-file results.csv
# Using short flags (-e earliest, -l latest, -c count, -f fields, -o output format)
splunk-as search oneshot "index=main" -e -1h -l now -c 100 -f host,status -o json
# Save to file with --output-file
splunk-as search oneshot "index=main" -e -1h -c 100 --output-file results.csv
Normal Search (Async)
# Create job and poll
splunk-as search normal "index=main | stats count" --wait
# Create job only (returns SID)
splunk-as search normal "index=main | stats count"
# Then use: splunk-as search results <SID>
Blocking Search (Sync)
# Wait for completion and return results
splunk-as search blocking "index=main | head 10" --timeout 60
Get Results
# From completed job
splunk-as search results 1703779200.12345
# With pagination (using short flags)
splunk-as search results 1703779200.12345 -c 100 --offset 0
# Specific fields only
splunk-as search results 1703779200.12345 -f host,status,uri
# Output format and save to file
splunk-as search results 1703779200.12345 -o json
splunk-as search results 1703779200.12345 --output-file results.csv
Validate SPL
# Validate SPL syntax
splunk-as search validate "index=main | stats count"
# Validate with suggestions for fixes (-s/--suggestions)
splunk-as search validate "index=main | stats count" -s
API Endpoints
| Endpoint | Mode | Description |
|---|---|---|
POST /services/search/jobs/oneshot | Oneshot | Inline results |
POST /services/search/v2/jobs | Normal | Create async job |
POST /services/search/v2/jobs + exec_mode=blocking | Blocking | Sync wait |
GET /services/search/v2/jobs/{sid}/results | - | Get results |
GET /services/search/v2/jobs/{sid}/results_preview | - | Get preview |
Request Parameters
| Parameter | Description | Default |
|---|---|---|
search | SPL query | Required |
earliest_time | Start time | -24h |
latest_time | End time | now |
exec_mode | normal/blocking | normal |
max_count | Max results | 50000 |
output_mode | json/csv/xml | json |
Best Practices
- Always include time bounds - Prevents full index scans
- Use oneshot for ad-hoc - Minimal resource usage
- Add fields command - Reduce data transfer
- Validate SPL first - Catch syntax errors early
- Handle pagination - Use count/offset for large results
SPL Quick Reference
# Basic search with time
index=main earliest=-1h | head 100
# Statistics
index=main | stats count by status | sort -count
# Time chart
index=main | timechart span=1h count by sourcetype
# Field extraction
index=main | fields host, status, uri | table host status uri
# Filtering
index=main status>=400 | stats count by status
# Subsearch
index=main [search index=alerts | fields src_ip | head 100]
Related Skills
- splunk-job - Job lifecycle
- splunk-export - Large exports
- splunk-metadata - Field discovery
splunk-security
Token management, RBAC, and ACL verification for Splunk.
Purpose
Manage JWT tokens, check permissions, and configure ACLs on knowledge objects.
Risk Levels
| Operation | Risk | Notes |
|---|---|---|
| Get current user | - | Read-only |
| List users/roles | - | Read-only |
| List tokens | - | Read-only |
| Get capabilities | - | Read-only |
| Check permission | - | Read-only |
| Get ACL | - | Read-only |
| Create token | ⚠️ | Security credential created |
| Delete token | ⚠️⚠️ | Breaks dependent integrations |
| Modify ACL | ⚠️⚠️ | Changes access permissions |
Triggers
- "token", "permission", "ACL"
- "security", "RBAC", "role"
- "access", "capabilities"
CLI Commands
| Command | Description |
|---|---|
security whoami | Get current user info |
security list-users | List all users |
security list-roles | List all roles |
security list-tokens | List auth tokens |
security create-token | Create auth token |
security delete-token | Delete auth token |
security capabilities | Get user capabilities |
security check | Check if user has capability |
security acl | Get ACL for resource |
Options
| Option | Commands | Description |
|---|---|---|
-o, --output | whoami, list-users, list-roles, list-tokens, capabilities, acl | Output format (text, json) |
-n, --name | create-token | Token name (required) |
--audience | create-token | Token audience (optional) |
--expires | create-token | Expiration time in seconds (optional) |
Examples
# Get current user info (with output format)
splunk-as security whoami
splunk-as security whoami -o json
# List users
splunk-as security list-users
splunk-as security list-users -o json
# List roles
splunk-as security list-roles
splunk-as security list-roles -o json
# List tokens
splunk-as security list-tokens
splunk-as security list-tokens -o json
# Create token (--name required, --audience and --expires optional)
splunk-as security create-token -n "my-app-token"
splunk-as security create-token -n "my-app-token" --audience "my-app" --expires 2592000
# Delete token
splunk-as security delete-token token_123
# Get capabilities (current user)
splunk-as security capabilities
splunk-as security capabilities -o json
# Check if user has a specific capability (positional argument)
splunk-as security check search
# Get ACL (full REST path starting with /)
splunk-as security acl /servicesNS/nobody/search/saved/searches/MySearch
splunk-as security acl /servicesNS/nobody/search/saved/searches/MySearch -o json
API Endpoints
GET/POST/DELETE /services/authorization/tokens- TokensGET/POST /services/data/transforms/lookups/{name}/acl- ACL
splunk-tag
Knowledge object tags and field/value associations for Splunk.
Purpose
Add, remove, and manage tags associated with field values for easier searching.
Risk Levels
| Operation | Risk | Notes |
|---|---|---|
| List tags | - | Read-only |
| Search by tag | - | Read-only |
| Add tag | ⚠️ | Easily reversible |
| Remove tag | ⚠️ | Easily reversible |
Triggers
- "tag", "label", "classify"
- "tag field", "add tag"
CLI Commands
| Command | Description |
|---|---|
tag add | Add tag to field value |
tag remove | Remove tag from field value |
tag list | List all tags |
tag search | Search using tag= syntax |
Options
| Option | Commands | Description |
|---|---|---|
-a, --app | list, add, remove | App context (defaults to "search") |
-o, --output | list, search | Output format (text, json) |
-i, --index | search | Filter by index |
-e, --earliest | search | Earliest time (defaults to -24h) |
Examples
# List all tags (with short flags)
splunk-as tag list
splunk-as tag list -a search -o json
# Add tag to field value (format: field::value tag_name)
splunk-as tag add host::webserver01 production
splunk-as tag add host::webserver01 production -a my_app
# Remove tag from field value
splunk-as tag remove host::webserver01 production
splunk-as tag remove host::webserver01 production -a my_app
# Search by tag (with short flags)
splunk-as tag search production
splunk-as tag search production -e -1h -i main
splunk-as tag search production -e -1h -o json
SPL Patterns
tag=web_traffic
tag::src_ip=internal
Commands 4
Splunk Assistant Skills Setup
You are helping the user set up Splunk Assistant Skills. This is a one-time setup that configures:
- A shared Python virtual environment at
~/.assistant-skills-venv/ - Required Python dependencies
- Splunk connection credentials (URL, authentication)
- A
claude-asshell function for running Claude with the venv activated
Setup Process
Step 1: Create Python Virtual Environment
First, create the shared virtual environment:
python3 -m venv ~/.assistant-skills-venv
Step 2: Activate and Install Dependencies
Activate the venv and install the required packages:
source ~/.assistant-skills-venv/bin/activate && pip install --upgrade pip && pip install splunk-as
Step 3: Configure Splunk Credentials
Run the environment setup script to configure Splunk connection:
bash "${CLAUDE_PLUGIN_ROOT}/../../scripts/setup-env.sh"
This will prompt for:
- Splunk URL (e.g., https://splunk.example.com)
- Management port (default: 8089)
- Authentication method (Bearer token or Basic auth)
- Default app and index settings
Step 4: Create claude-as Shell Function
Add the claude-as function to the user's shell RC file. This function activates the venv before running Claude:
For bash users (~/.bashrc):
cat >> ~/.bashrc << 'EOF'
# Claude with Assistant Skills venv
claude-as() {
source ~/.assistant-skills-venv/bin/activate
claude "$@"
deactivate
}
EOF
For zsh users (~/.zshrc):
cat >> ~/.zshrc << 'EOF'
# Claude with Assistant Skills venv
claude-as() {
source ~/.assistant-skills-venv/bin/activate
claude "$@"
deactivate
}
EOF
Step 5: Verify Installation
Test that the setup is complete:
source ~/.assistant-skills-venv/bin/activate && python -c "from splunk_as import get_splunk_client; print('Library installed successfully')"
Important Notes
- After setup, use
claude-asinstead ofclaudeto run with the Assistant Skills venv activated - Credentials are stored in
~/.envwith secure permissions (chmod 600) - To reconfigure credentials later, run the setup script again:
bash "${CLAUDE_PLUGIN_ROOT}/../../scripts/setup-env.sh" - For profile-based configuration, see the CLAUDE.md documentation
Troubleshooting
If you encounter issues:
- Python not found: Ensure Python 3.8+ is installed
- Permission denied: Check that ~/.assistant-skills-venv is writable
- Connection failed: Verify Splunk URL and port are accessible
- Authentication failed: Check token validity or username/password
Browse Splunk Assistant Skills
Display all 14 available Splunk Assistant Skills with their purpose and trigger keywords.
Skill Catalog
| Skill | Purpose | Triggers |
|---|---|---|
splunk-assistant | Central hub and router - routes requests to specialized skills | splunk, search, query, SPL |
splunk-search | SPL query execution (oneshot, normal, blocking modes) | search, SPL, query, find, oneshot, blocking |
splunk-job | Search job lifecycle (create, monitor, pause, cancel) | job, SID, status, progress, cancel, pause |
splunk-export | High-volume streaming data extraction | export, download, extract, stream, ETL |
splunk-metadata | Index, source, sourcetype discovery | metadata, index, source, sourcetype, fields |
splunk-lookup | CSV and lookup file management | lookup, CSV, upload, lookup table |
splunk-kvstore | App Key Value Store operations | kvstore, collection, key-value, persist |
splunk-savedsearch | Reports and scheduled searches | saved search, report, schedule |
splunk-alert | Alert triggering and monitoring | alert, trigger, notification, monitor |
splunk-app | Application management | app, application, install, package |
splunk-security | Token management, RBAC, ACL | token, permission, ACL, RBAC, security |
splunk-rest-admin | REST API configuration access | rest, admin, config, server, settings |
splunk-tag | Knowledge object tagging | tag, label, classify |
splunk-metrics | Real-time metrics (mstats, mcatalog) | metrics, mstats, mcatalog, time series |
Quick Start Commands
# Search
splunk-as search oneshot "index=main | head 10"
splunk-as search normal "index=main | stats count" --wait
# Jobs
splunk-as job list
splunk-as job status <SID>
# Metadata
splunk-as metadata indexes
splunk-as metadata sourcetypes --index main
# Administration
splunk-as admin info
splunk-as security whoami
Getting More Info
Use /skill-info <skill-name> to see detailed documentation for a specific skill.
Example: /skill-info splunk-search
Skill Information: {{ skill }}
Display detailed documentation for the specified Splunk Assistant skill.
Instructions
Read the SKILL.md file for the requested skill and present:
- Purpose: What the skill does
- Triggers: Keywords that activate this skill
- CLI Commands: Available
splunk-ascommands with examples - API Endpoints: Underlying Splunk REST API endpoints
- Best Practices: Tips for effective usage
- Related Skills: Other skills that work together
Skill Location
The skill documentation is at:
${CLAUDE_PLUGIN_ROOT}/skills/{{ skill }}/SKILL.md
Available Skills
- splunk-assistant
- splunk-search
- splunk-job
- splunk-export
- splunk-metadata
- splunk-lookup
- splunk-kvstore
- splunk-savedsearch
- splunk-alert
- splunk-app
- splunk-security
- splunk-rest-admin
- splunk-tag
- splunk-metrics
If the skill name is not found, suggest similar skills from the list above.
Splunk Instance Discovery
Discover and display information about the connected Splunk instance.
Discovery Steps
Step 1: Verify Connection
Check connectivity to the Splunk Search Head on management port 8089:
splunk-as admin info
This returns:
- Server version and build
- Deployment type (Cloud vs on-prem)
- Connection status
- Current user and capabilities
Step 2: Check Server Health
splunk-as admin health
Step 3: List Available Indexes
splunk-as metadata indexes
Step 4: Check User Permissions
splunk-as security whoami
Expected Output
After running discovery, summarize:
- Connection Status: Connected/Not Connected
- Splunk Version: e.g., 9.1.0
- Deployment Type: Splunk Enterprise, Splunk Cloud, etc.
- Current User: Username and roles
- Available Indexes: List of accessible indexes
- Key Capabilities: What operations are permitted
Troubleshooting
If connection fails:
- Verify
SPLUNK_SITE_URLenvironment variable is set - Check
SPLUNK_TOKENorSPLUNK_USERNAME/SPLUNK_PASSWORD - Ensure port 8089 is accessible
- Run
/assistant-skills-setupto reconfigure
Sponsors
Details
- Marketplace
- grandcamel/Splunk-Assistant-Skills
- Source
- .
- Author
- grandcamel
- Category
- Productivity
- Keywords
- splunk, search, spl, siem, automation, devops, natural-language