telegraf/plugins/processors/template
RobMalvern 15d0166922
Add template processor (#6494)
2020-02-06 12:40:03 -08:00
..
README.md Add template processor (#6494) 2020-02-06 12:40:03 -08:00
template.go Add template processor (#6494) 2020-02-06 12:40:03 -08:00
template_metric.go Add template processor (#6494) 2020-02-06 12:40:03 -08:00
template_test.go Add template processor (#6494) 2020-02-06 12:40:03 -08:00

README.md

Template Processor

The template processor applies a go template to tag, field, measurement and time values to create a new tag.

Golang Template Documentation

Configuration

  # Concatenate two tags to create a new tag
  [[processors.template]]
     ## Tag to create
     tag = "topic"
     ## Template to create tag
     # Note: Single quotes (') are used, so the double quotes (") don't need escaping (\")
     template = '{{ .Tag "hostname" }}.{{ .Tag "level" }}'

Example

- cpu,level=debug,hostname=localhost value=42i
+ cpu,level=debug,hostname=localhost,topic=localhost.debug value=42i