Telegraf input data formats
Telegraf input plugins consume data in one or more data formats and
parse the data into Telegraf [metrics][/telegraf/v1/metrics/].
Many input plugins use configurable parsers for parsing data formats into metrics.
This allows input plugins such as kafka_consumer
input plugin
to consume and process different data formats, such as InfluxDB line
protocol or JSON.
Telegraf supports the following input data formats:
Avro
Use the avro
input data format to parse Avro binary or JSON data into Telegraf metrics.
Binary
Use the binary
input data format with user-specified configurations to parse binary protocols into Telegraf metrics.
Collectd
Use the collectd
input data format to parse collectd network binary protocol to create tags for host, instance, type, and type instance.
CSV
Use the csv
input data format to parse comma-separated values into Telegraf metrics.
Dropwizard
Use the dropwizard
input data format to parse Dropwizard JSON representations into Telegraf metrics.
Form URL-encoded
Use the form-urlencoded
data format to parse application/x-www-form-urlencoded
data, such as HTTP query strings.
Graphite
Use the graphite
input data format to parse Graphite dot buckets into Telegraf metrics.
Grok
Use the grok
data format to parse line-delimited data using a regular expression-like language.
InfluxDB line protocol
Use the influx
line protocol input data format to parse InfluxDB metrics directly into Telegraf metrics.
JSON
The json
input data format parses JSON objects, or an array of objects, into Telegraf metrics.
For most cases, use the JSON v2 input data format instead.
JSON v2
Use the json_v2
input data format to parse [JSON][json] objects, or an array of objects, into Telegraf metrics.
Logfmt
Use the logfmt
input data format to parse logfmt data into Telegraf metrics.
Nagios
Use the nagios
input data format to parse the output of Nagios plugins into Telegraf metrics.
OpenTSDB Telnet PUT API
Use the opentsdb
data format to parse OpenTSDB Telnet PUT
API data into Telegraf metrics.
Prometheus Remote Write
Use the prometheusremotewrite
input data format to parse Prometheus Remote Write samples into Telegraf metrics.
Value
Use the value
input data format to parse single values into Telegraf metrics.
Wavefront
Use the wavefront
input data format to parse Wavefront data into Telegraf metrics.
XML
Use the xml
input data format to parse XML data into Telegraf metrics.
XPath JSON
Use the xpath_json
input data format and XPath expressions to parse JSON into Telegraf metrics.
XPath MessagePack
Use the xpath_msgpack
input data format and XPath expressions to parse MessagePack data into Telegraf metrics.
XPath Protocol Buffers
Use the xpath_protobuf
input data format and XPath expressions to parse protobuf (Protocol Buffer) data into Telegraf metrics.
Any input plugin containing the data_format
option can use it to select the
desired parser:
[[inputs.exec]]
## Commands array
commands = ["/tmp/test.sh", "/usr/bin/mycollector --foo=bar"]
## measurement name suffix (for separating different commands)
name_suffix = "_mycollector"
## Data format to consume.
## Each data format has its own unique set of configuration options, read
## more about them here:
## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
data_format = "json_v2"
Input parser plugins
When you specify a data_format
in an input plugin configuration that supports it, the input plugin uses the associated parser plugin to convert data from its source format into Telegraf metrics.
Many parser plugins provide additional configuration options for specifying details about your data schema and how it should map to fields in Telegraf metrics.
Was this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for Telegraf and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.