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

Elasticsearch Output: Support using tag in template name #9695

Open
kevisong opened this issue Aug 31, 2021 · 2 comments
Open

Elasticsearch Output: Support using tag in template name #9695

kevisong opened this issue Aug 31, 2021 · 2 comments
Labels
area/elasticsearch feature request Requests for new plugin and for new features to existing plugins

Comments

@kevisong
Copy link

Feature Request

Opening a feature request kicks off a discussion.

Proposal: Support using tag with notation {{tag_name}} in template name

Current behavior: index_name supports using tag as part of the name. But template_name can only be hardcoded.

[global_tags]
  monitor = "http"
[[outputs.elasticsearch]]
  urls = [ "http://127.0.0.1:9200" ]
  index_name = "telegraf-{{monitor}}-%Y.%m.%d"
  template_name = "telegraf-http"

Desired behavior: Both index_name and template_name support tag notation

[global_tags]
  monitor = "http"
[[outputs.elasticsearch]]
  urls = [ "http://127.0.0.1:9200" ]
  index_name = "telegraf-{{monitor}}-%Y.%m.%d"
  template_name = "telegraf-{{monitor}}"

Use case:

When the global_tags.monitor is changed, the hardcoded template_name = "telegraf-http" may be forgotten.

If template_name supports tag reference, we only need to change the global_tags.monitor and the template_name will be modified automatically.

@kevisong kevisong added the feature request Requests for new plugin and for new features to existing plugins label Aug 31, 2021
@reimda
Copy link
Contributor

reimda commented Apr 21, 2022

Do you still need this functionality? Are you able to implement it and submit a PR? Thanks!

@reimda reimda added the waiting for response waiting for response from contributor label Apr 21, 2022
@kevisong
Copy link
Author

Do you still need this functionality? Are you able to implement it and submit a PR? Thanks!

Yeah. This feature might be helpful when there is a fair amount of elasticsearch outputs using the same global_tags.

I can implement it and submit a PR later on.

@telegraf-tiger telegraf-tiger bot removed the waiting for response waiting for response from contributor label Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/elasticsearch feature request Requests for new plugin and for new features to existing plugins
Projects
None yet
Development

No branches or pull requests

2 participants