The Wayback Machine - http://web.archive.org/web/20201024200809/https://github.com/influxdata/telegraf/issues/7702
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

Support modifying the field key with data_format=value #7702

Open
danielnelson opened this issue Jun 17, 2020 · 0 comments
Open

Support modifying the field key with data_format=value #7702

danielnelson opened this issue Jun 17, 2020 · 0 comments

Comments

@danielnelson
Copy link
Contributor

@danielnelson danielnelson commented Jun 17, 2020

Feature Request

Proposal:

Add a new option value_field = "whatever" that will set the field key used by the parser

Current behavior:

Parser always uses value as the field key.

Desired behavior:

Parse should allow user to provide an appropriately descriptive field key.

Use case:

We have experienced the same behavior with exec input plugin and data format:

[[inputs.exec]]
  commands = ["/bin/bash -c \"curl -s http://127.0.0.1:8080/tunnelcount | grep -Eo '[0-9]+'\""]
  data_format = "value"
  name_override = "tunnels_total"

# OUTPUTS

[[outputs.prometheus_client]]
  listen = ":9126"
  expiration_interval = "120s"
  collectors_exclude = ["gocollector", "process"]
  metric_version = 2
# It shows tunnels_total as metric name
telegraf --test --input-filter exec

However, the metric name in the endpoint is tunnels_total_value

Thank you

Originally posted by @AntonioAlfrz in #7171 (comment)

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

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.