Ingest Splunk HEC events
Ingest one or more Splunk HEC event envelopes. Bodies may contain multiple envelopes, concatenated or newline-delimited. The target dataset is resolved from the index query parameter, then the index field of the first event, then the dataset the token is scoped to when it grants ingest access to exactly one dataset.
Parameters #
| Property | Type | Location | Description |
|---|---|---|---|
index | string | query | The dataset (Splunk index) to ingest into. Overrides the index field in the event envelope. |
Body #
A Splunk HEC event envelope.
application/json| Property | Type | Description |
|---|---|---|
event | unknown | The event payload. When an object, its keys become top-level fields of the Axiom event. When a string, it is stored in the _raw field. |
fields | object | Additional fields merged into the event. |
time | unknown | The event timestamp, as epoch seconds, epoch milliseconds, or an RFC 3339 string. When omitted, Axiom assigns the ingest time. |
index | string | The dataset (Splunk index) to ingest into. The index query parameter takes precedence. |
host | string | |
source | string | |
sourcetype | string |
Request #
curl -X POST 'https://hec.{axiom-domain}/services/collector/event' \
-H 'Authorization: Bearer API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"event":{"message":"hello from HEC","severity":"INFO"},"sourcetype":"httpevent"}'Try itRun this request against your Axiom organization
Credentials stay in this browser tab and are only sent to Axiom when you run the request.
Response #
200The events were accepted.400The request could not be processed. The `code` field identifies the Splunk error: `5` (no data), `6` (invalid data format), or `7` (incorrect index).| Property | Type | Description |
|---|---|---|
text | stringRequired | A human-readable status message. |
code | integerRequired | The Splunk status code. 0 indicates success, 17 indicates a healthy collector, and 5, 6, and 7 indicate no data, invalid data format, and incorrect index respectively. |