Docs
DocumentationQuery ReferenceAPI Reference
Open Console→→
DocumentationQuery ReferenceAPI Reference

Platform overview

What is Axiom?QuickstartArchitectureFeatures
Fundamentals
Datasets
Edge deployments
Limits
Performance
Optimize usage
Requirements
Semantic conventions
Glossary
Tour
SecurityRoadmap

Send data

Reference architecturesMethods

Understand data

Console
Query
Builder
Editor
Query results
Visualize
Traces
Metrics
Correlations
Save queries
Stream
Dashboard
Create
Elements
Create
Configure
Element types
Gauge
Heatmap
Log stream
Monitor list
Note
Pie chart
Scatter plot
Statistic
Table
Time series
Sections
Configure
Filter
Annotate
Monitor
Overview
View status
Configure
Examples
Monitor types
Anomaly
Match
Threshold
Alerting
Overview
Configure
Notifier types
Custom Webhook
Discord
Email
Microsoft Teams
Opsgenie
PagerDuty
Slack
Manage
Datasets
Overview
Views
Virtual fields
Access
RBAC
Tokens
CLI
Organization
Audit log
Settings
Usage and billing
Profile
Extend
Overview
AWS Lambda
AWS PrivateLink
Cloudflare Workers
Cloudflare Logpush
Convex
Grafana
Hex
Netlify
Supabase
Tailscale
Terraform
Unkey
Vercel
Intelligence
Overview
Spotlight
AI agents
Overview
MCP Server
Overview
Tools
Query cost limits
Agent-created orgs
Skills
Overview
Axiom alerting
Build dashboards
Control costs
Query metrics
SRE
Translate SPL to APL
Splunk
Overview
Splunk app
Install and configure
Commands
Examples
Portal
How it works
Set up standard mode
Set up transparent mode
Observability Cloud
SPL command support
Examples
Monitor and troubleshoot

Use cases

ObservabilityProduct analytics
LLM observability
Overview
Use Axiom AI SDK
Manual instrumentation
GenAI attributes
Redaction policies

Miscellaneous

LLMs
Overview
List of docs pages
Full docs
Query reference
FAQs
Legal
Acceptable use policy
Cookies
Data processing
HIPAA
Partner agreement
Partner program guide
Privacy policy
SLA
Terms of service
Terms of use

Send data to Axiom using the Splunk HEC API

This page explains how to send data to Axiom through the Splunk HTTP Event Collector (HEC) compatible API.

Axiom offers a Splunk HTTP Event Collector (HEC) compatible API so you can send events from Splunk forwarders, the OpenTelemetry splunk_hec exporter, and any other HEC client without changing your existing tooling.

The HEC API is served from a dedicated host on your edge deployment: hec.AXIOM_DOMAIN. For example, if your edge deployment’s base domain is us-east-1.aws.edge.axiom.co, the HEC endpoint is https://hec.us-east-1.aws.edge.axiom.co.

Prerequisites

  • Create an Axiom account.
  • Create a dataset in Axiom where you send your data.
  • Create an API token in Axiom with permissions to ingest data to the dataset you have created.
Info

Replace AXIOM_DOMAIN with the base domain of your edge deployment. For more information, see Edge deployments.

The HEC endpoints are hosted at hec.AXIOM_DOMAIN, a dedicated subdomain of your edge deployment’s base domain.

Authentication

Authenticate every request with an Axiom API token that has permission to ingest into the target dataset. The HEC API accepts the token in any of the following schemes:

SchemeHeader
Splunk (default HEC clients)Authorization: Splunk API_TOKEN
BearerAuthorization: Bearer API_TOKEN
BasicAuthorization: Basic <base64 of x:API_TOKEN> (for example, curl -u x:API_TOKEN)

Requests without a valid token are rejected with 401 Unauthorized (missing token) or 403 Forbidden (token not permitted for the dataset).

Choose the target dataset

In Splunk, events are routed by index. Axiom maps the HEC index to an Axiom dataset and resolves it in the following order:

  1. The index query parameter, for example ?index=DATASET_NAME.
  2. The index field inside the event envelope.
  3. The dataset the API token is scoped to, when the token grants ingest access to exactly one dataset.

If none of these resolve to a dataset, the request is rejected with HEC code 7 (Incorrect index).

Send events

Send JSON events to /services/collector/event. The bare /services/collector path is an alias of the event endpoint. Each request body is one or more HEC event envelopes, which may be concatenated (newline-delimited or back-to-back).

shell
curl -X POST 'https://hec.AXIOM_DOMAIN/services/collector/event?index=DATASET_NAME' \
    -H 'Authorization: Splunk API_TOKEN' \
    -H 'Content-Type: application/json' \
    -d '{"event": {"message": "hello from HEC", "severity": "INFO"}, "sourcetype": "httpevent"}'

A successful ingest returns 200 OK with the Splunk status body:

JSON
{"text": "Success", "code": 0}

Event envelope fields

Axiom interprets the standard HEC envelope fields as follows:

FieldBehavior
eventWhen an object, its keys become top-level fields of the Axiom event. When a string, it is stored in the _raw field.
fieldsMerged into the event as top-level fields.
timeParsed as the event timestamp (_time). Accepts epoch seconds, epoch milliseconds, or an RFC 3339 string. When omitted, Axiom assigns the ingest time.
indexSelects the target dataset (see Choose the target dataset) and is also retained as a field.
host, source, sourcetypeRetained as fields on the event.

Send raw events

Send arbitrary payloads to /services/collector/raw. Metadata is supplied through query parameters rather than an envelope. Each line of a text/plain body becomes an event; JSON bodies are also accepted.

shell
curl -X POST 'https://hec.AXIOM_DOMAIN/services/collector/raw?index=DATASET_NAME&sourcetype=mysourcetype&source=mysource&host=myhost' \
    -H 'Authorization: Splunk API_TOKEN' \
    -H 'Content-Type: text/plain' \
    --data-binary 'a raw log line
another raw log line'

Compressed payloads

The HEC API accepts gzip-compressed request bodies. Set Content-Encoding: gzip and send the gzipped payload:

shell
curl -X POST 'https://hec.AXIOM_DOMAIN/services/collector/event?index=DATASET_NAME' \
    -H 'Authorization: Splunk API_TOKEN' \
    -H 'Content-Type: application/json' \
    -H 'Content-Encoding: gzip' \
    --data-binary @events.json.gz

Check service health

GET /services/collector/health (and the versioned /services/collector/health/1.0) report whether the collector is accepting data. No authentication is required.

shell
curl 'https://hec.AXIOM_DOMAIN/services/collector/health'
JSON
{"text": "HEC is healthy", "code": 17}

Response codes

Responses follow the Splunk HEC convention: an HTTP status code plus a JSON body carrying a Splunk code.

HTTP statusHEC codeMeaning
2000Success.
20017The collector is healthy (health endpoints only).
4005No data. The request body was empty.
4006Invalid data format. The body could not be parsed.
4007Incorrect index. The target dataset could not be resolved.
401—Missing or unsupported authentication.
403—The token is not permitted to ingest into the dataset.
Was this page helpful?
Suggest edits on GitHub
On this page
AuthenticationChoose the target datasetSend eventsEvent envelope fieldsSend raw eventsCompressed payloadsCheck service healthResponse codes