Splunk -> 获取以毫秒为单位的时间
Splunk -> Get time taken in milliseconds
我有 splunk json 日志条目,其中包含 epochSecond、nanoOfSecond、eventid 和 message 字段。
我想找到事件的平均时间、95perc 等以毫秒为单位的时间(由所有日志条目中的唯一 eventid 定义),这是事件的第一个日志条目和最后一个日志条目之间的时间差。
如何在 Splunk 中执行此操作?我什至无法以毫秒为单位获取每个事件的持续时间
stats range(_time) as duration by eventid -> 似乎给出的时间是秒,而不是毫秒
stats range(timestamp) as duration by eventid -> 什么都不给
stats range(epochSecond * 1000000000 + nanoOfSecond) as duration by eventid -> 给出语法错误
在 Splunk 中,_time 是秒计数器,因此 stats range(_time)
将是秒数。
如果时间戳字段类似于“2020-11-11 09:27”,那么 stats range(timestamp)
就没有意义,因为没有字符串范围之类的东西(至少在 Splunk 中没有) .
尝试stats range(eval(epochSecond*1000000000 + nanoOfSecond))
。
我有 splunk json 日志条目,其中包含 epochSecond、nanoOfSecond、eventid 和 message 字段。 我想找到事件的平均时间、95perc 等以毫秒为单位的时间(由所有日志条目中的唯一 eventid 定义),这是事件的第一个日志条目和最后一个日志条目之间的时间差。
如何在 Splunk 中执行此操作?我什至无法以毫秒为单位获取每个事件的持续时间
stats range(_time) as duration by eventid -> 似乎给出的时间是秒,而不是毫秒 stats range(timestamp) as duration by eventid -> 什么都不给 stats range(epochSecond * 1000000000 + nanoOfSecond) as duration by eventid -> 给出语法错误
在 Splunk 中,_time 是秒计数器,因此 stats range(_time)
将是秒数。
如果时间戳字段类似于“2020-11-11 09:27”,那么 stats range(timestamp)
就没有意义,因为没有字符串范围之类的东西(至少在 Splunk 中没有) .
尝试stats range(eval(epochSecond*1000000000 + nanoOfSecond))
。