我有一个 splunk 查询,可以为我提供某个字段每天的平均值、最大值和百分位数 95。我想在结果上再添加一行以及总体值。
即
timechart span=1d avg(field), max(field), exactperc95(field)
还有
stats avg(field), max(field), exactperc95(field)
_时间 | 平均 | 最大 | 95页 |
---|---|---|---|
2020-01-23 | 1.5 | 5 | 4 |
2020-01-24 | 1.2 | 8 | 7 |
2020-01-25 | 1.4 | 5 | 4 |
2020-01-26 | 1.1 | 7 | 6 |
整体 | 1.3 | 8 | 6 |
appendpipe
命令应该可以完成这项工作。它通过指定的命令运行当前结果集,并将其结果添加到现有结果中。
...
| timechart span=1d avg(field) as avg, max(field) as max, exactperc95(field) as p95
| appendpipe [ stats avg(field) as avg, max(field) as max, exactperc95(field) as p95
| eval _time = "overall" ]