如果主机处于非活动状态超过 5 分钟,则进行 Splunk 搜索

Splunk search if host is inactive for more than 5 minutes

我在每个用户搜索的 splunk 数据中有两条特定消息。

示例:

index="document" (message="inactive" OR message="active") 

不确定如何根据每个用户的时间戳计算出这两条消息之间的时间?

也许这会有所帮助。

index="document" (message="inactive" OR message="active")
```Create a new field called "duration" that the difference between the last value of _time and the current value```
| streamstats window=2 range(_time) as duration by user
```Show only the active users with duration greater than 5 minutes (300 seconds)```
| where (message="inactive" AND duration>300)