Logit.io
Point Splunk HEC senders at Logit.io
← Back to blog
12/2/2026 · 13 min read

Point Splunk HEC senders at Logit.io

Logit.io Team
Logit.io Team
Technical Content Team

Last updated 12/2/2026

How To GuidesLog Management

To point an existing Splunk HEC sender at Logit.io, use your stack’s API host, send uncompressed envelopes to /services/collector/event and authenticate with the stack API key as the HEC token. Turn off indexer acknowledgement. Confirm HTTP 200 with HEC code 0, then find the same event ID in OpenSearch Dashboards to verify it was indexed.

Contents

An endpoint change can leave a sender reporting healthy while the logs your team needs are still missing from Discover. Work through one log stream first. Keep the source and payload format steady, send a pair of events with known IDs and check what actually arrives. Write down the field path and time range that found those events so the person on the next shift can repeat the check.

Choose one sender and one log stream

Sign in to Logit.io, select the destination Logs stack in the Splunk HEC integration guide and follow its Install Integration step. Use the API endpoint and stack API key shown in the guide for that stack. Record the destination stack next to the sender’s name in your change notes. That gives the person opening Discover a way to check they are looking in the same place the sender is writing.

For a client that takes a full URL, use the HTTPS event route. The published aliases are:

/services/collector/event/1.0
/services/collector

Some senders take a base URL and build the path themselves. Check which setting you have before pasting the endpoint. A full event path in a base URL setting can give you a different request URL from the one you tested with curl.

Set the stack’s UUIDv4 API key as the sender’s HEC token. A direct request can supply it as Authorization: Splunk <key>. If a request carries more than one supported auth header, ApiKey takes precedence over Api-Key, which takes precedence over Authorization. A stale header can make a new token appear broken. Keep one auth mechanism on the test sender and keep keys out of URLs and the verification notes.

Use uncompressed bodies and turn off indexer acknowledgement. Check these settings on the actual sender, especially if it already has a working configuration that you are carrying forward. The health route can respond without credentials. A healthy response confirms liveness, so use a write with a known event ID to verify the host, key and log path together.

Send two events you can find by ID

Start with a small structured payload. The outer envelope carries metadata such as source. Put your application fields inside the required event key. The example uses two events from a demonstration inventory worker. Both messages could occur every time a worker starts. The distinct IDs let you tell these test records from earlier runs and see when a retry sent one twice.

Save these two lines as hec-canary.ndjson. Use fresh IDs for each independent test. Preserve the original IDs if retrying the same two events.

{"event":{"id":"hec-cutover-01-start","message":"Demo inventory worker started"},"source":"inventory-worker"}
{"event":{"id":"hec-cutover-01-ready","message":"Demo inventory worker ready"},"source":"inventory-worker"}

Save the script as send-hec.sh. Its default host is a placeholder. In your environment, set HEC_BASE_URL to the selected stack’s API base URL and supply LOGIT_API_KEY through your usual secret configuration. Run bash send-hec.sh from the directory containing the payload. The command preserves the line endings and prints the HTTP status, headers and body. The --fail-with-body flag requires curl 7.76 or later. It makes one attempt, so you can diagnose the first response before choosing whether to resend.

#!/usr/bin/env bash
set -euo pipefail
: "${LOGIT_API_KEY:?Set LOGIT_API_KEY to the selected stack API key}"
HEC_BASE_URL="${HEC_BASE_URL:-https://your-stack.example}"
payload="${1:-hec-canary.ndjson}"

curl --silent --show-error --include --fail-with-body \
  --connect-timeout 3 --max-time 15 \
  -H "Authorization: Splunk ${LOGIT_API_KEY}" \
  -H 'Content-Type: application/json' \
  --data-binary "@${payload}" \
  "${HEC_BASE_URL%/}/services/collector/event"

On HTTP 200, look for HEC code 0 in the response body. This illustrative response means both envelopes were queued for processing. Keep the event IDs and the send time for the search.

{"text":"Success","code":0}
HEC verification from sender to Discover
Send a HEC envelope with a known ID, check HTTP 200 with HEC code 0, then find that ID in Discover.

The endpoint also accepts one JSON envelope, an array of envelopes or consecutive envelope objects. Use the format your sender emits and check that its output is a sequence of complete envelopes. A bare application JSON object can be syntactically valid and still fail if it has no event key. The API checks the whole request before queueing any envelope, so one malformed item can reject an otherwise well-formed batch.

Move the existing log route

Once the manual request works, repeat the test from the actual sender with one known input stream. That exercises the settings the manual check bypasses, including the path it builds, the token it loads and whether it compresses the body. Keep the endpoint and output selection scoped to that input while you check the results. A working curl request tells you where to start looking if the sender can’t reproduce the result.

For Vector, the following sink assumes you already have a source or transform named inventory_logs. Replace the source ID and base URL for your setup. Replace the token placeholder with the selected stack’s API key using your deployment’s secret configuration. The sink’s endpoint target selects the event route. If you use the OpenTelemetry Collector or Fluent Bit, use the exporter or output form in the integration guide and apply it to the logs pipeline or input tags for the same stream. If your Fluent Bit output uses Match *, narrow the match to the stream you are moving first.

[sinks.logit_hec]
type = "splunk_hec_logs"
inputs = ["inventory_logs"]
endpoint = "https://your-stack.example"
default_token = "YOUR_STACK_API_KEY"
endpoint_target = "event"
compression = "none"
encoding.codec = "json"
acknowledgements.indexer_acknowledgements_enabled = false

Use a fresh ID when you repeat the check through the sender. If both the manual request and the sender emit the same ID, a matching document tells you that one route worked. Give each route a distinguishable ID and verify the sender’s record specifically. Capture one normal application log too, so the change record includes both the controlled test and the field layout downstream searches will actually use.

After the sender runs, capture an ID from a record it emitted and check that the ID survived the output’s encoding. Search for that specific value in Discover. The field path depends on what the sender put inside event. If you looked up event.id.keyword for the curl example, inspect a sender record before assuming its application currently emits an id field. The goal is to prove that the real output carries a value your team can search for later.

Check the size of a representative request as well as the one-event case. The limit is 9,800,000 bytes for the body and for each serialised envelope. The guide’s starting point is about 1 MB or 1,000 events, whichever comes first. Treat the count as a sizing target. A few large records can hit the byte limit in a batch well below 1,000, and the sender’s envelope adds bytes to every application record. Measure the encoded request body if you need to troubleshoot which case you have. See the HTTPS log API batching guide for more on request sizes and HTTP 413 and 503 responses.

Check the document that Discover received

Open Discover in OpenSearch Dashboards on the selected stack. On the default Logstash route, select logstash-* with @timestamp. If your stack routes these logs to a custom index, select that pattern. Select DQL and set the time picker to cover the send time. On the default pipeline the event route uses ingestion time for @timestamp, leaving any envelope time value as supplied. Search for the two test IDs with this prefix query.

event.id.keyword : hec-cutover-01-*

Expand both documents and check event.id, event.message and source. The .keyword subfield in the query is for string values mapped as text with a keyword subfield, as in the examples here. The field you read in the expanded document is event.id. If a filter has changed the field name or shape on your stack, use the indexed document to choose the query field.

Discover showing two demonstration HEC logs with nested event IDs and messages
These two unmarked demonstration logs show their IDs and messages under event.

The default path leaves object fields under event and envelope metadata at the root. If your sender includes an envelope index value, look for it as a document field. Use the index pattern that contains the record for your search. The supplied value doesn’t select the OpenSearch destination. String values in event or host can conflict with object mappings, depending on your stack’s index template.

Test any normalisation with a marked event

If the stack needs a flat message field or source event time, use the optional Logstash filter from the HEC normalisation instructions. Add it in Stack > Settings > Logstash Pipelines. It only processes envelopes with the opt-in marker that also satisfy its guards. Those guards help keep Beats, unmarked OpenTelemetry logs and already typed records such as raw HEC events outside the filter.

Save this as hec-marked.json and send it with:

bash send-hec.sh hec-marked.json

The example time is 08:20 UTC on 2 December 2026. Replace it with the test event’s Unix time if you are running this later. The filter accepts Unix seconds, including fractional seconds, and whole Unix milliseconds for modern timestamps. Use a time picker range that covers the supplied time as well as the send time during the check.

{
  "event": {
    "id": "hec-cutover-02-ready",
    "message": "Demo inventory worker ready"
  },
  "time": 1796199600,
  "source": "inventory-worker",
  "fields": {"logit_hec": "normalise"}
}

For a marked object, the filter moves envelope metadata under splunk, copies payload fields to the root where the keys are available and sets type: splunk_hec. A marked text payload moves to message. A successful parse of time supplies @timestamp. In Discover, search for the root id from the marked example.

type.keyword : "splunk_hec" and id.keyword : "hec-cutover-02-ready"
Discover showing one normalised demonstration HEC log with a root-level ID
This marked demonstration log shows a root-level ID and the supplied 08:20 UTC timestamp.

Inspect a full document before updating any saved search that reads those fields. The same application ID can be nested under event on the unmarked path and at the root on the marked path. If you roll out the filter to one sender at a time, the two shapes can coexist in a single time window. Check a recent event from each sender before using the count from just one field path.

Check the root message, splunk.source and @timestamp. Keep the earlier unmarked sample handy so you can verify the original search path still works on it. If the sender only sends unmarked events, adding the filter alone leaves those events on the default path. If the ID moved successfully but the absolute time falls outside the current picker, the document can disappear from the same view where you first verified the unmarked records.

Collect the HTTP status and the HEC code together. HTTP 400 has more than one cause, and HTTP 200 means different things on the health and event routes. The choices below assume you are debugging the event route unless the row mentions raw HEC.

HTTP / HECWhat to checkAction before the next attempt
200 / 0The request queued successfully.Search for a known ID in Discover and open the document.
400 / 5The event body is empty, malformed or missing a required event key.Check every item. Remove nonstandard JSON numbers such as NaN and regenerate the envelope.
400 / 10A request to /services/collector/raw lacks a channel.Provide X-Splunk-Request-Channel or the channel query parameter if you intended to use raw HEC.
401 / 4The token is missing or invalid.Check its format, the Authorization header and whether another supported header takes precedence.
403 / 1The key does not resolve to an active stack.Check which stack supplied it. A new stack’s key can take up to five minutes to work. Repoint the sender to an active stack and use that stack’s API key, or remove the sender or drain.
413 / 9The request or a serialised envelope exceeds the byte limit.Split the body. If a single envelope is still oversized, reduce the event before resending it.
503 / 8A temporary failure can occur after some events have queued.Honour Retry-After: 5. Keep IDs stable and account for duplicates when you check the result.

For connection errors, timeouts, HTTP 429 and server errors, use capped exponential backoff with jitter and respect Retry-After when present. A timeout tells you the sender missed a response. Keep track of the IDs the sender attempted so you can reconcile them with Discover, including cases where more than one record arrived for the same ID.

Suppose the example’s first event was queued and the second caused a temporary failure. A retry of both can give you two copies of hec-cutover-01-start and one of hec-cutover-01-ready. The prefix query can show three hits even though only two distinct events were generated. Deduplicate downstream using the stable event ID if repeated records matter for your counts. Each new source event needs its own ID for that check to work.

If the sender has a successful response and Discover is empty, start with the same stack and send time, then check which field path and timestamp your pipeline uses. With a marked envelope, look for its root ID around its event time. For a default structured envelope, look under event around ingestion time. If one shape works and the other doesn’t, repeat with one event and inspect the field’s expected type before changing the whole sender.

Start Free Trial

Unlock complete visibility with hosted ELK, Grafana, and Prometheus-backed Observability

Start Free Trial

Frequently asked questions

Can I use the health route to test my stack’s API key?

Use the event route for that test. The health route returns HTTP 200 with code 17 without authentication and checks liveness only.

Will the envelope’s index value create a target index?

The default path keeps it as the document’s index field. The optional normalisation filter moves it to splunk.index.

Does raw HEC split a multiline body into separate logs?

It queues the whole decoded body as one event. Provide a channel on the raw route. To send independently searchable structured events, send separate envelopes to the event route.

Can I leave gzip or indexer acknowledgement enabled?

Disable both before switching the sender. The HEC endpoint accepts uncompressed requests. An HTTP 200 with code 0 confirms queue acceptance. Search for the event ID to confirm indexing.

Is 1,000 events a hard HEC request limit?

It is a suggested sizing target. The enforced limit is 9,800,000 encoded bytes per request body and per serialised envelope.

The Logit.io free trial includes every feature, so you can send a test event and confirm it in OpenSearch Dashboards. Explore Logit.io Log Management to collect and search logs in OpenSearch Dashboards.

Get the latest Elastic Stack & logging resources when you subscribe

Want to see this in action?
Start a free trial and connect logs to your alert workflows.