【发布时间】:2015-07-24 02:58:20
【问题描述】:
我关注 Splunk Query,它试图将 Epoch 捕获的开始和结束时间格式化为人类可读的格式,但似乎 splunk 在这里提取了不正确的值...
index=wd_test source=*-1.0.0.log
| fieldformat c_start=strftime(start,"%m/%d/%Y %H:%M:%S")
| convert timeformat="%m/%d/%Y %H:%M:%S" ctime(end) as c_end
| eval duration=(end-start)/1000
| table start, c_start, end, c_end , duration, sla
作为执行上述查询的一部分,我得到以下结果
start c_start end c_end duration sla
1 1430167363808 12/31/9999 23:59:59 1430167364085 12/31/9999 23:59:59 0.277000 2
2 1430167236667 12/31/9999 23:59:59 1430167236856 12/31/9999 23:59:59 0.189000 2
有人可以帮我解决这个问题吗?我在这里尝试了 2 种不同的方法,但都没有奏效。
使用以下 Online Epoch 格式的工具我能够成功转换,但不能使用 Splunk...
http://www.freeformatter.com/epoch-timestamp-to-date-converter.html
【问题讨论】: