telegraf/plugins/processors/date/README.md

30 lines
773 B
Markdown
Raw Normal View History

2019-06-14 19:08:10 +00:00
# Date Processor Plugin
2019-06-14 19:26:47 +00:00
Use the `date` processor to add the metric timestamp as a human readable tag.
2019-06-14 19:08:10 +00:00
2019-06-14 19:26:47 +00:00
A common use is to add a tag that can be used to group by month or year.
2019-06-14 19:08:10 +00:00
2019-06-14 19:26:47 +00:00
A few example usecases include:
1) consumption data for utilities on per month basis
2019-06-14 19:08:10 +00:00
2) bandwith capacity per month
2019-06-14 19:26:47 +00:00
3) compare energy production or sales on a yearly or monthly basis
2019-06-14 19:08:10 +00:00
2019-06-14 19:26:47 +00:00
### Configuration
2019-06-14 19:08:10 +00:00
```toml
[[processors.date]]
2019-06-14 19:26:47 +00:00
## New tag to create
tag_key = "month"
2019-06-14 19:08:10 +00:00
2019-06-14 19:26:47 +00:00
## Date format string, must be a representation of the Go "reference time"
## which is "Mon Jan 2 15:04:05 -0700 MST 2006".
date_format = "Jan"
```
2019-06-14 19:08:10 +00:00
2019-06-14 19:26:47 +00:00
### Example
2019-06-14 19:08:10 +00:00
2019-06-14 19:26:47 +00:00
```diff
- throughput lower=10i,upper=1000i,mean=500i 1560540094000000000
+ throughput,month=Jun lower=10i,upper=1000i,mean=500i 1560540094000000000
2019-06-14 19:08:10 +00:00
```