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

Cannot peronalize tags on inputs per-plugin instance #662

Closed
sunbit opened this issue Feb 8, 2016 · 3 comments · Fixed by #667
Closed

Cannot peronalize tags on inputs per-plugin instance #662

sunbit opened this issue Feb 8, 2016 · 3 comments · Fixed by #667
Labels
bug unexpected problem or unintended behavior

Comments

@sunbit
Copy link

sunbit commented Feb 8, 2016

I tried to add custom per-plugin tags, with the syntax

[[inputs.exec]]
  command = "/var/graphs/telegraf/odenergy.sh"
  name_override = "consumption"
  interval = 60

   [inputs.exec.tags]
   type = "power"

And it works, but if i try to set a tag on a second instance of the same plugin for example:

[[inputs.exec]]
  command = "/var/graphs/telegraf/odenergy.sh"
  name_override = "consumption"
  interval = 60

   [inputs.exec.tags]
   type = "power"

[[inputs.exec]]
  command = "/var/graphs/telegraf/odenergy.sh"
  name_override = "consumption_2"
  interval = 10

   [inputs.exec.tags]
   type = "power2"

I get an error, pointing at the line defining the second .tags section:

toml: line 123: tableinputs.snmp.tags' is in conflict with normal table in line 106`

Is possible to accomplish this in some way?

@sparrc
Copy link
Contributor

sparrc commented Feb 8, 2016

hmm, this is supposed to be valid toml, I'll investigate

@sparrc sparrc added the bug unexpected problem or unintended behavior label Feb 8, 2016
@sparrc
Copy link
Contributor

sparrc commented Feb 8, 2016

it looks like our underlying toml library has a bug, I created an issue: naoina/toml#18

I'm going to try to migrate to https://github.com/pelletier/go-toml, that library appears to parse the toml correctly.

sparrc added a commit that referenced this issue Feb 8, 2016
@sparrc
Copy link
Contributor

sparrc commented Feb 8, 2016

@sunbit Due to the nature of dynamically applying the config to structs, it would be a huge amount of work to port to the pelletier/go-toml library.

Instead I'm going to workaround this by renaming the global [tags] section to [global_tags], it'll be available in 0.10.3.

@sunbit for the time being, if you're not using the global [tags] table, you can remove that section from your config file and it should parse OK.

Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants