Prerequisites
- Splunk Enterprise or Splunk Cloud instance (version 8.x or later)
- REST API access on port 8089
- A bearer token with search capability (see Generating a Bearer Token)
Setup
Option 1: Interactive CLI
Option 2: Environment variables
Add to your.env:
Option 3: Persistent store
Multi-instance setup
To connect multiple Splunk instances (e.g. separate prod and staging clusters):SPLUNK_INSTANCES is set it overrides the single-instance SPLUNK_URL / SPLUNK_TOKEN variables.
Generating a bearer token
HealOps uses bearer tokens — not basic auth and not HEC tokens. To generate one: Via the Splunk UI:- Go to Settings → Tokens
- Click New Token
- Set a name (e.g.
healops) and an expiry date - Copy the generated token
<PASSWORD> with your admin password):
search capability. The admin role includes this by default. For a dedicated service account, ensure the role includes:
searchread_splunkd_private_settings(needed for the verify call against/services/server/info)
Verify
How queries are generated
HealOps builds SPL queries deterministically from the alert payload — the LLM selects which tool to call but never writes the query itself. This keeps investigations reproducible and auditable. Query construction priority:
To pass a specific SPL query through an alert, set
commonAnnotations.splunk_query:
Test with the built-in alert template
Troubleshooting
Security best practices
- Use a read-only bearer token — never use an admin token in production.
- Store
SPLUNK_TOKENin.envor the credential store, not in source code or CI logs. - Prefer a dedicated
healopsservice account with only thesearchcapability. - For enterprise self-signed certificates, set
SPLUNK_CA_BUNDLEto the CA bundle path rather than disabling verification entirely. - Set
SPLUNK_VERIFY_SSL=falseonly in local or dev environments when you cannot supply a CA bundle. - Rotate tokens on a schedule and revoke them when no longer needed.
Tracer