Logging 将时间图表导入streamstats

Logging 将时间图表导入streamstats,logging,charts,frequency,splunk,Logging,Charts,Frequency,Splunk,我们有特定事件的splunk索引。事件按事件类型分类 我需要找到固定大小(比如说,5分钟)的窗口,其中任何事件的频率(每秒事件数)比前一个窗口下降/上升超过预设百分比(比如说,50%) 一、 没有成功,尝试了以下方法: index=index_of_events | eval cnt=1 | timechart span=20s limit=40 per_second(cnt) as ev by ev_type useother=f usenull=f | streamstats wind

我们有特定事件的splunk索引。事件按事件类型分类

我需要找到固定大小(比如说,5分钟)的窗口,其中任何事件的频率(每秒事件数)比前一个窗口下降/上升超过预设百分比(比如说,50%)

一、 没有成功,尝试了以下方法:

 index=index_of_events | eval cnt=1 | timechart span=20s limit=40 per_second(cnt) as ev  by ev_type useother=f usenull=f |
 streamstats window=40 global=false first(ev) as start last(ev) as end by ev_type | 
 eval diff=abs(start-end) | eval max_val=max(start, end) | 
 where diff > 0 AND max > 0 | eval prc=100*diff/max_val | where prc > 50
这种方法可行吗?我可以将
timechart
直接传送到
streamstats
吗?或者我需要在它们之间使用类似
untable
的东西吗

有没有更好的方法来完成这样的任务


如果可能的话,我还想排除低频事件(不关心
2/sec
是否变成
1/sec
)。

通常时间图表最好留到最后,请尝试统计

(删除//注释)

search ...
// group by type
| stats count by type
// establish a 'normal'
| streamstats window=5 global=f median(count) as floating_median by type
// calculate delta
| eval diff = count-floating_median
| eval diff_percent = diff/floating_median
// find outliers
| eventstats max(diff_percent) as diff_percent_max by type
| where diff_percent_max > 0.5
// visualise
| timechart sum(count) as count by type