Skip to main content

splunk-hec-logging

splunk-hec-logging

Builds a JSON access-log entry for each request/response, wraps it in a Splunk HEC event envelope ({time, source, sourcetype, event}), and ships accumulated batches to a Splunk HTTP Event Collector. Batches are POSTed as concatenated JSON events with an Authorization: Splunk <token> header. Place this node in the response pipeline, after the upstream node.

Configuration

KeyTypeDefaultDescription
endpoint.uristring— (required)HEC collector URL, e.g. https://splunk:8088/services/collector. A top-level uri is also accepted.
endpoint.tokenstring— (required)HEC token, sent as Authorization: Splunk <token>.
endpoint.channelstringSent as the X-Splunk-Request-Channel header.
endpoint.timeoutinteger (s)10Whole-call deadline per flush.
sourcestringfeatherbit-splunk-hec-loggingHEC event source field.
ssl_verifybooltrueVerify TLS certificates.
log_formatobjectCustom flat entry of name -> "$var template".
include_req_bodyboolfalseAdd the request body to the default entry.
include_resp_bodyboolfalseAdd the response body to the default entry.
batch_max_sizeinteger1000Flush when the buffer reaches this many entries.
inactive_timeoutinteger (s)5Flush after this idle period.
buffer_durationinteger (s)60Flush when the oldest buffered entry is this old.
max_retry_countinteger0Retries after a failed flush before dropping the batch.
retry_delayinteger (s)1Delay between retries.
max_pending_entriesinteger10000Queue capacity; entries are dropped with a warning when full.
- id: access-log
type: splunk-hec-logging
config:
endpoint:
uri: https://splunk:8088/services/collector
token: 00000000-0000-0000-0000-000000000000
ssl_verify: true
batch_max_size: 1000

Behavior

The node is a pure passthrough: it never modifies the context and never fails, so only its success port is ever taken. push is fire-and-forget and never blocks the request path — when the queue is full, entries are dropped with a tracing::warn!. Each entry becomes a HEC event {time, source, sourcetype: "_json", event}; a batch is sent as the events concatenated with no separator (the format HEC expects). Delivery, batching, timing, and retries all run on a background task.