Skip to main content

Splunk HEC

Synopsis

Creates an HTTP Event Collector listener that receives events from Splunk forwarders and HEC-compatible senders over HTTP or HTTPS.

Schema

- id: <numeric>
name: <string>
description: <string>
type: splunkhec
tags: <string[]>
pipelines: <pipeline[]>
status: <boolean>
properties:
port: <numeric>
address: <string>
tokens: <string[]>
max_body_size: <numeric>
enable_ack: <boolean>
reuse: <boolean>
workers: <numeric>
tls:
status: <boolean>
cert_name: <string>
key_name: <string>
min_version: <string>
insecure_skip_verify: <boolean>

Configuration

Device

FieldRequiredDefaultDescription
idY-Unique numeric identifier
nameY-Device name
descriptionN-Optional description
typeY-Must be splunkhec
tagsN-Optional tags
pipelinesN-Optional pre-processor pipelines
statusNtrueEnable/disable the device

Connection

FieldRequiredDefaultDescription
portY-TCP port to listen on
addressN"0.0.0.0"Network address to bind
tokensN-Array of accepted HEC tokens; omit or leave empty for open access
max_body_sizeN26214400Maximum decompressed request body size in bytes (default 25 MB)
enable_ackNfalseEnable indexer acknowledgement support
reuseNtrueEnable multi-worker mode
workersNCPU countNumber of worker processes when reuse is enabled

TLS

FieldRequiredDefaultDescription
tls.statusNfalseEnable TLS encryption
tls.cert_nameY*-TLS certificate. Accepts a file name (resolved relative to the service root directory) or inline PEM content (when the value starts with -----BEGIN).
tls.key_nameY*-TLS private key. Same value semantics as tls.cert_name.
tls.min_versionN-Minimum accepted TLS version (e.g., 1.2, 1.3)
tls.insecure_skip_verifyNfalseSkip peer certificate verification

* = Required when tls.status is true.

Details

The device exposes the following HTTP endpoints on the configured port:

EndpointMethodPurpose
/services/collectorPOSTJSON event submission
/services/collector/eventPOSTJSON event submission (alternate)
/services/collector/rawPOSTRaw text line submission
/services/collector/raw/1.0POSTRaw text line submission (versioned)
/services/collector/healthGETHealth check; no authentication required
/services/collector/health/1.0GETHealth check (versioned); no authentication required
/services/collector/ackPOSTIndexer acknowledgement

The device validates the Authorization header using these schemes in order: Splunk <token>, Bearer <token>, bare token (no scheme prefix), and the ?token= query parameter as a fallback. When no tokens are configured, all requests are accepted without authentication. Health endpoints never require authentication.

Request bodies may be gzip-compressed (Content-Encoding: gzip). The max_body_size limit is enforced on the decompressed output, not on the compressed wire bytes, which prevents gzip-bomb payloads from expanding into memory unchecked.

The JSON event endpoints accept batched requests containing multiple concatenated JSON objects per body — a format that is standard HEC batch mode and is not valid single-document JSON. Each object must contain at least one of the fields event or fields at the top level; objects that fail this check return HEC error code 12.

The raw endpoint accepts plain text bodies. Each non-empty line is wrapped in a {"_raw":"..."} envelope. Per-request metadata fields (host, source, sourcetype, index) are read from query parameters and injected into every line envelope when present. When enable_ack is true, the raw endpoint also requires a channel identifier provided via the channel query parameter or the X-Splunk-Request-Channel header.

When enable_ack is true, the ACK endpoint echoes all submitted ack IDs back as confirmed (synthetic ACK). This unblocks senders that hold open connections waiting for ACK confirmation without requiring per-request state tracking. When enable_ack is false, the ACK endpoint remains registered and returns HEC error code 14 (ACK disabled) rather than a 404, matching expected Splunk behavior.

Examples

Basic

Creating a minimal HEC listener on port 8088 with open access...

- id: 1
name: basic_splunk_hec
type: splunkhec
properties:
port: 8088

Token Authentication

Restricting access to named tokens...

- id: 2
name: secure_splunk_hec
type: splunkhec
properties:
port: 8088
tokens:
- "a8b3c1d2-e4f5-6789-abcd-ef0123456789"
- "b9c4d3e5-f6a7-8901-bcde-f01234567890"

TLS

Enabling HTTPS with a TLS certificate and token authentication...

- id: 3
name: tls_splunk_hec
type: splunkhec
properties:
port: 8088
tokens:
- "a8b3c1d2-e4f5-6789-abcd-ef0123456789"
tls:
status: true
cert_name: "hec.crt"
key_name: "hec.key"

Acknowledgement

Enabling synthetic indexer acknowledgement for senders that require ACK confirmation...

- id: 4
name: ack_splunk_hec
type: splunkhec
properties:
port: 8088
tokens:
- "a8b3c1d2-e4f5-6789-abcd-ef0123456789"
enable_ack: true
note

ACK IDs are always confirmed immediately. The device does not track per-event indexing state.

High-Volume

Tuning for high-throughput ingestion with increased body size limit and worker count...

- id: 5
name: highvol_splunk_hec
type: splunkhec
properties:
port: 8088
tokens:
- "a8b3c1d2-e4f5-6789-abcd-ef0123456789"
max_body_size: 52428800
reuse: true
workers: 8