Form Urlencoded input data format

This page documents an earlier version of Telegraf. Telegraf v1.17 is the latest stable version.

The form-urlencoded data format parses application/x-www-form-urlencoded data, commonly used in the query string.

A common use case is to pair it with http_listener_v2 input plugin to parse request body or query parameters.


  ## Address and port to host HTTP listener on
  service_address = ":8080"

  ## Part of the request to consume.  Available options are "body" and
  ## "query".
  data_source = "body"

  ## Data format to consume.
  ## Each data format has its own unique set of configuration options, read
  ## more about them here:
  data_format = "form_urlencoded"

  ## Array of key names which should be collected as tags.
  ## By default, keys with string value are ignored if not marked as tags.
  form_urlencoded_tag_keys = ["tag1"]

Examples - basic parsing

Example config:

  name_override = "mymetric"
  service_address = ":8080"
  data_source = "query"
  data_format = "form_urlencoded"
  form_urlencoded_tag_keys = ["tag1"]

Example request:

curl -i -XGET 'http://localhost:8080/telegraf?tag1=foo&field1=0.42&field2=42'

Example output:

mymetric,tag1=foo field1=0.42,field2=42

Cloud or OSS?

InfluxDB OSS 2.0 now generally available!

InfluxDB OSS 2.0 is now generally available and ready for production use. See the InfluxDB OSS 2.0 release notes.

For information about upgrading to InfluxDB OSS 2.0, see: