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

Unable to use nested configuration #38

Closed
joshuaspence opened this issue Sep 13, 2016 · 2 comments
Closed

Unable to use nested configuration #38

joshuaspence opened this issue Sep 13, 2016 · 2 comments

Comments

@joshuaspence
Copy link
Contributor

I was trying to use the following Hiera configuration to create a Telegraf input:

telegraf::inputs:
  elasticsearch:
    cluster_health: true
    local: false
    servers: ['http://127.0.0.1']
    tags:
      role: 'some_role'

This resulted in the following (snippet) of configuration:

[[inputs.elasticsearch]]
  cluster_health = true
  local = false
  servers = ["http://127.0.0.1"]
  tags = {"role"=>"some_role"}

This is wrong and causes telegraf to fail:

Error parsing /etc/telegraf/telegraf.conf, toml: line 42: parse error

Rather, it should become;

[[inputs.elasticsearch]]
  cluster_health = true
  local = false
  servers = ["http://127.0.0.1"]
  [inputs.elasticsearch.tags]
    role = "some_role"

It looks like this is already supported by telegraf::input, so I think that the real issue here is that specifying inputs in $telegraf::inputs doesn't actually utilize the telegraf::input resource.

@doomnuggets
Copy link
Contributor

doomnuggets commented Jan 29, 2017

Not sure if this is still an issue.
Solving this would require a slight change in your hiera parameterization.

telegraf::inputs:
  elasticsearch:
    cluster_health: true
    local: false
    servers: ['http://127.0.0.1']
    sections:
      'elasticsearch.tags':
        role: 'some_role'

Refer to the README Example 3

@yankcrime
Copy link
Member

Fixed via #80.

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

No branches or pull requests

3 participants