Skip to content
Cisco AI Defense logo
CiscoAI Security

Splunk integration — DefenseClaw

Overview

DefenseClaw supports Splunk HEC and Splunk Observability Cloud through the unified observability setup. The Python CLI also keeps defenseclaw setup splunk as a compatibility wrapper, but new automation should use setup observability add ... so the same writer handles all destinations.

TargetWhat it ingestsPreset
Splunk Enterprise / Cloud (HEC)Audit events — the primary forensic trailsplunk-hec
Splunk Observability CloudOpenTelemetry metrics + tracessplunk-o11y

HEC (audit events)

Non-interactive

export DEFENSECLAW_SPLUNK_HEC_TOKEN=<token>
defenseclaw setup observability add splunk-hec \
  --name splunk-prod \
  --host hec.corp.example.com \
  --port 8088 \
  --index defenseclaw \
  --source defenseclaw/gateway \
  --sourcetype defenseclaw:audit \
  --token "$DEFENSECLAW_SPLUNK_HEC_TOKEN" \
  --non-interactive
FlagDefaultNotes
--hostlocalhostHEC host without scheme
--port8088HEC port
--indexmainSplunk index to write to
--sourcedefenseclawSets source on every event
--sourcetypedefenseclaw:auditSets sourcetype on every event
--tokenfrom $DEFENSECLAW_SPLUNK_HEC_TOKENStored in .env, never in config.yaml
--verify-tls / --no-verify-tlspreset defaultControl TLS verification for sinks that expose the shared flag

The connectivity probe sends a single event with event={"probe":true} and expects HTTP 200 with {"text":"Success"}. On failure the sink is not persisted.

What is emitted

HEC receives one event per audit row. The JSON shape matches the audit schema (event_type, correlation_id, verdict, rule_id, severity, etc.). Events are sent in batches of up to 100 with a 2-second max flush; the sidecar buffers up to 10000 events before applying back-pressure to scanner writers.

Splunk Observability Cloud (metrics + traces)

export SPLUNK_O11Y_TOKEN=<ingest-token>
defenseclaw setup observability add splunk-o11y \
  --name splunk-o11y \
  --realm us1 \
  --token $SPLUNK_O11Y_TOKEN \
  --signals metrics,traces \
  --non-interactive
FlagEffect
--realmO11y realm (us0, us1, eu0, …) — selects the https://ingest.{realm}.signalfx.com endpoint
--tokenIngest token (stored in .env under DEFENSECLAW_SPLUNK_O11Y_TOKEN)
--signalsmetrics, traces, metrics,traces (default)
Metrics shipped match the OTel spec — guardrail latency histograms, scanner counters, and the sidecar's process-level Go runtime metrics.

Bridged local export

On developer laptops the CLI ships a vendored Splunk local bridge (~/.defenseclaw/splunk-bridge/). It's not a sink — it's a small HEC emulator that writes events to $CLAW_HOME/splunk/ so operators can inspect the on-the-wire payloads without standing up a real HEC. Activate it by pointing splunk-hec at http://127.0.0.1:8088 during setup. The bridge is seeded during init and is not started automatically; run ~/.defenseclaw/splunk-bridge/start.sh.

Verify ingestion

# Trigger an audit event
defenseclaw skill scan some-skill --path ~/.claw/skills/some-skill

# HEC: query Splunk
# search: index=defenseclaw sourcetype=defenseclaw:audit earliest=-5m | head 5

# Re-run probe
defenseclaw setup observability test splunk-prod

If events don't appear within ~30s, check ~/.defenseclaw/gateway.log for audit.sinks.splunk-prod: http 401 Unauthorized (stale token) or audit.sinks.splunk-prod: flush timeout (HEC unreachable).

Troubleshooting

SymptomCauseFix
probe failed: 403Token lacks index or sourcetype permissionsRotate token; grant submit-data
probe failed: x509: certificate signed by unknown authorityInternal CAUse --no-verify-tls for a lab-only check, or add the CA to the OS trust store
Batches rejected intermittentlyHEC rate limitRaise HEC maxEventSize and HEC channel count; back-pressure will slow scanners, not lose events
Gaps in metrics but traces OKO11y realm mismatch--realm must match the token's realm

Related