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
Monitor
Overview
View status
Configure
Examples
Monitor types
Anomaly
Match
New values
Threshold
Alerting
Overview
Configure
Notifier types
Amp
ChatGPT Workspace Agent
Claude Code
Cursor
Custom Webhook
Discord
Email
incident.io
Jira Service Management
Microsoft Teams
Opsgenie
PagerDuty
Slack
Annotations
Command Menu
Manage
Datasets
Overview
Views
Virtual fields
Access
RBAC
Tokens
CLI
Organization
Labels
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
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
OCSF data
OCSF as CIM
SPL command support
Examples
Monitor and troubleshoot

Use cases

ObservabilityProduct analytics
OCSF security data
Overview
Send data
Query data
LLM observability
Overview
Use Vercel AI SDK
Manual instrumentation
GenAI attributes
Redaction policies

Miscellaneous

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

Send data from Telegraf to Axiom

This page explains how to send data from Telegraf to Axiom.

Telegraf is an open-source, plugin-driven agent that collects metrics and events from your systems, services, and apps. To send the data that Telegraf collects to Axiom, use the HTTP output plugin of Telegraf.

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.
  • Install Telegraf version 1.24.0 or later.

Configure Telegraf

  1. Set up the Telegraf configuration file based on the Telegraf documentation.

  2. In the Telegraf configuration file, use the HTTP output plugin with the following configuration. For more information on the plugin, see the Telegraf documentation.

    TOML
    [[outputs.http]]
      url = "https://AXIOM_DOMAIN/v1/ingest/DATASET_NAME"
      method = "POST"
      content_encoding = "gzip"
      data_format = "json"
      json_transformation = '[metrics.{"_time": timestamp, "name": name, "tags": tags, "fields": fields}]'
      [outputs.http.headers]
        Content-Type = "application/json"
        Authorization = "Bearer API_TOKEN"
Info

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

Replace API_TOKEN with the Axiom API token you have generated. For added security, store the API token in an environment variable.

Replace DATASET_NAME with the name of the Axiom dataset where you send your data.

Info

Keep the json_transformation setting. It sends each metric as a separate event and sets the _time field to the time when Telegraf collects the metric. Without this setting, Telegraf sends all metrics of a flush in one JSON object, and Axiom stores them as a single event.

Example configuration

The following example collects CPU and memory metrics, changes the host tag with a processor plugin, and sends the data to Axiom:

TOML
# Input Plugins
[[inputs.cpu]]
  percpu = true
  totalcpu = true
  collect_cpu_time = false
  report_active = false

[[inputs.mem]]
  # No specific configuration required

# Processor Plugins
[[processors.regex]]
  namepass = ["cpu", "mem"]
  [[processors.regex.tags]]
    key = "host"
    pattern = "(.*)"
    replacement = "${1}-processed"

# Output Plugins
[[outputs.http]]
  url = "https://AXIOM_DOMAIN/v1/ingest/DATASET_NAME"
  method = "POST"
  content_encoding = "gzip"
  data_format = "json"
  json_transformation = '[metrics.{"_time": timestamp, "name": name, "tags": tags, "fields": fields}]'
  [outputs.http.headers]
    Content-Type = "application/json"
    Authorization = "Bearer API_TOKEN"

To start Telegraf with the configuration file, run the following command:

shell
telegraf --config telegraf.conf

Query your data

Each metric arrives in Axiom as a separate event with the following fields:

FieldDescription
nameName of the metric. For example, cpu or mem
tagsTags of the metric. For example, tags.host and tags.cpu
fieldsValues of the metric. For example, fields.usage_user and fields.used_percent

For example, the following query charts the average user CPU usage over time:

APL
['DATASET_NAME']
| where name == 'cpu' and ['tags.cpu'] == 'cpu-total'
| summarize avg(['fields.usage_user']) by bin_auto(_time)
Was this page helpful?
Suggest edits on GitHub
On this page
Configure TelegrafExample configurationQuery your data