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

Allow week number to be used in the elasticsearch output index template #3476

Closed
hemasalma opened this issue Nov 15, 2017 · 3 comments
Closed
Labels
feature request Requests for new plugin and for new features to existing plugins
Milestone

Comments

@hemasalma
Copy link

Hello,

We have installed telegraf and tried to send metrics data to elasticsearch ouput and that worked properly.

In config file in
[[outputs.elasticsearch]] block we have option for daily indexing data in elasticsearch
i.e., index=index-name-%Y-%m-%d

what we need is..
can we index data for a week of year basis..
i.e., instead of indexing data in a daily index basis it should be indexed in week of year basis..

@danielnelson
Copy link
Contributor

I can imagine adding more formatting symbols, I know in python they use %U and %W for week depending on what day of the week is the start of the week. In Go, the .ISOWeek() function seems to be equivalent to %W

@danielnelson danielnelson added the feature request Requests for new plugin and for new features to existing plugins label Nov 15, 2017
@danielnelson danielnelson changed the title ES: output plugin weekly index Allow week number to be used in the elasticsearch output index template Nov 15, 2017
@lpic10
Copy link
Contributor

lpic10 commented Nov 16, 2017

In linux date it can be %U, %V or %W also depending on first day of the week, being %V the ISO week number. Since python 3.6 there is also %V for ISO week number. If you agree on using ISO week, I think it makes sense to use that as well.

@danielnelson
Copy link
Contributor

That sounds perfect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Requests for new plugin and for new features to existing plugins
Projects
None yet
Development

No branches or pull requests

3 participants