Skip to main content
HealOps queries Splunk using the REST API to surface relevant log evidence during alert investigations — searching indexes with SPL, correlating error patterns with incidents, and identifying root causes.

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

Select Splunk when prompted and provide your REST API base URL and bearer token.

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):
When 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:
  1. Go to SettingsTokens
  2. Click New Token
  3. Set a name (e.g. healops) and an expiry date
  4. Copy the generated token
Via the REST API (replace <PASSWORD> with your admin password):
The token needs the search capability. The admin role includes this by default. For a dedicated service account, ensure the role includes:
  • search
  • read_splunkd_private_settings (needed for the verify call against /services/server/info)

Verify

Expected output:

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

This runs a synthetic investigation using a pre-built alert fixture — no live alert infrastructure needed.

Troubleshooting

Security best practices

  • Use a read-only bearer token — never use an admin token in production.
  • Store SPLUNK_TOKEN in .env or the credential store, not in source code or CI logs.
  • Prefer a dedicated healops service account with only the search capability.
  • For enterprise self-signed certificates, set SPLUNK_CA_BUNDLE to the CA bundle path rather than disabling verification entirely.
  • Set SPLUNK_VERIFY_SSL=false only in local or dev environments when you cannot supply a CA bundle.
  • Rotate tokens on a schedule and revoke them when no longer needed.