Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telegraf: Add examples of running processors in order #2323

Closed
sjwang90 opened this issue Mar 19, 2021 · 0 comments
Closed

Telegraf: Add examples of running processors in order #2323

sjwang90 opened this issue Mar 19, 2021 · 0 comments
Assignees
Labels

Comments

@sjwang90
Copy link
Contributor

Add some example scenarios for ordering processors
Relevant docs page: https://docs.influxdata.com/telegraf/v1.17/administration/configuration/#processor-configuration

order = n must be configured to run all involved processors in specific sequence.
https://github.com/influxdata/telegraf/blob/master/docs/CONFIGURATION.md#processor-plugins

Possible examples:

  1. GeoIP Processor(external plugin) + S2 Geo Processor
[[processors.execd]]
  order = 1
  command = ["/path/to/geoip_binary", "--config", "/path/to/geoip_config_file"]

[[processors.s2geo]]
  order = 2
  ## The name of the lat and lon fields containing WGS-84 latitude and
  ## longitude in decimal degrees.
  lat_field = "lat"
  lon_field = "lon"

  ## New tag to create
  tag_key = "s2_cell_id"

  ## Cell level (see https://s2geometry.io/resources/s2cell_statistics.html)
  # cell_level = 9
  1. processors should run in the order they appear in the config telegraf#8016 example
[[inputs.file]]
  name_override = "filesystems_raw"
  files = ["./json.txt"]
  data_format = "value"
  data_type = "string"

[[processors.parser]]
  metric_name = "filesystems"
  order = 1
  namepass = "filesystems_raw"
  drop_original = false
  parse_fields = ["value"]
  data_format = "json"
  json_strict = true
  json_query = "filesystems./"
  tag_keys = [
    "mount",
    "device"
  ]

[[processors.parser]]
  metric_name = "filesystems"
  order = 2
  namepass = "filesystems_raw"
  drop_original = false
  parse_fields = ["value"]
  data_format = "json"
  json_strict = true
  json_query = "filesystems./usr"
  tag_keys = [
    "mount",
    "device"
  ]

[[processors.strings]]
  order = 3
  namepass = "filesystems_raw"
  fielddrop = ["value"] # deletes the metric

[[outputs.file]]
  namedrop = "filesystems_raw"
  files = ["stdout"]

***Implementation of this feature will add additional ordering capabilities

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants