[英]Logstash date parse failure with milliseconds since epoch
Logstash is not able to parse milliseconds since epoch and returns me an parse failure. 自epoch以来,Logstash无法解析毫秒,并向我返回解析失败。 There are no whitspaces in the content of the timestamo field in the xml and logstash selects the right value. xml中的timestamo字段的内容中没有任何空格,logstash选择正确的值。
filter {
xml {
source => "message"
remove_namespaces => true
store_xml => false
xpath => ["//event/@timestamp", "@time_since_epoch"]
}
date {
match => [ "@time_since_epoch","UNIX_MS" ]
target => "@time"
}
}
What I am doing wrong? 我做错了什么?
EDIT 编辑
sample xml data line: 样本xml数据行:
<event timestamp="1494599590213" ><message>Dummy message</message></event>
Apparently the value extracted from the xpath is put in an array (see: "@time_since_epoch":["1494599590213"]
with the stdout plugin and the json codec). 显然,从xpath提取的值放在一个数组中(请参阅: "@time_since_epoch":["1494599590213"]
带有stdout插件和json编解码器)。
So you'll need to access the time as an array element: 因此,您需要将时间作为数组元素进行访问:
date {
match => [ "[@time_since_epoch][0]","UNIX_MS" ]
target => "@time"
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.