2017-10-10 19:02:01 +00:00
# BasicStats Aggregator Plugin
2019-07-31 06:50:49 +00:00
The BasicStats aggregator plugin give us count,diff,max,min,mean,non_negative_diff,sum,s2(variance), stdev for a set of values,
2017-10-10 19:02:01 +00:00
emitting the aggregate every `period` seconds.
### Configuration:
```toml
# Keep the aggregate basicstats of each metric passing through.
[[aggregators.basicstats]]
## The period on which to flush & clear the aggregator.
period = "30s"
2019-09-23 22:39:50 +00:00
2017-10-10 19:02:01 +00:00
## If true, the original metric will be dropped by the
## aggregator and will not get sent to the output plugins.
drop_original = false
2017-12-15 00:56:10 +00:00
## Configures which basic stats to push as fields
2019-07-31 06:50:49 +00:00
# stats = ["count","diff","min","max","mean","non_negative_diff","stdev","s2","sum"]
2017-10-10 19:02:01 +00:00
```
2017-12-15 00:56:10 +00:00
- stats
2019-07-31 06:50:49 +00:00
- If not specified, then `count` , `min` , `max` , `mean` , `stdev` , and `s2` are aggregated and pushed as fields. `sum` , `diff` and `non_negative_diff` are not aggregated by default to maintain backwards compatibility.
2017-12-15 00:56:10 +00:00
- If empty array, no stats are aggregated
2017-10-10 19:02:01 +00:00
### Measurements & Fields:
- measurement1
- field1_count
2019-07-31 06:50:49 +00:00
- field1_diff (difference)
2017-10-10 19:02:01 +00:00
- field1_max
- field1_min
- field1_mean
2019-07-31 06:50:49 +00:00
- field1_non_negative_diff (non-negative difference)
2018-03-05 23:26:31 +00:00
- field1_sum
2017-10-10 19:02:01 +00:00
- field1_s2 (variance)
- field1_stdev (standard deviation)
### Tags:
No tags are applied by this aggregator.
### Example Output:
```
$ telegraf --config telegraf.conf --quiet
system,host=tars load1=1 1475583980000000000
system,host=tars load1=1 1475583990000000000
2019-07-31 06:50:49 +00:00
system,host=tars load1_count=2,load1_diff=0,load1_max=1,load1_min=1,load1_mean=1,load1_sum=2,load1_s2=0,load1_stdev=0 1475584010000000000
2017-10-10 19:02:01 +00:00
system,host=tars load1=1 1475584020000000000
system,host=tars load1=3 1475584030000000000
2019-07-31 06:50:49 +00:00
system,host=tars load1_count=2,load1_diff=2,load1_max=3,load1_min=1,load1_mean=2,load1_sum=4,load1_s2=2,load1_stdev=1.414162 1475584010000000000
2017-10-10 19:02:01 +00:00
```