输入是逗号分隔值: " 2010-08-19"" 09:12:55"" 56095675"
我创建了自定义date_time
字段,其格式正确2010-08-19;09:12:55
但不匹配。
filter {
grok {
match => { "message" => '"(%{GREEDYDATA:cust_date})","(%{TIME:cust_time})","(%{NUMBER:author})"'}
add_field => {
"date_time" => "%{cust_date};%{cust_time}"
}
}
date {
match => ["date_time", "yyyy-MM-dd;hh:mm:ss"]
target => "@timestamp"
add_field => { "debug" => "timestampMatched"}
}
Kibana的输出:
cust_date August 18th 2010, 20:00:00.000
cust_time 09:12:55
date_time 2010-08-19;09:12:55
message "2010-08-19","09:12:55","56095675"
tags beats_input_codec_plain_applied, _dateparsefailure
它给出了_dateparsefailure
。字段看起来与匹配模式相同。
我尝试了不同的时间格式,例如YYYY-MM-dd;hh:mm:ss
和YYYY-MM-dd;HH:mm:ss
我究竟做错了什么?
救命!
答案 0 :(得分:0)
您应该将date
插件放在filter
下的grok
部分内。
filter {
grok {
match => { "message" => '"(%{GREEDYDATA:cust_date})","(%{TIME:cust_time})","(%{NUMBER:author})"'}
add_field => {
"date_time" => "%{cust_date};%{cust_time}"
}
date {
match => ["date_time", "yyyy-MM-dd;hh:mm:ss"]
target => "@timestamp"
add_field => { "debug" => "timestampMatched"}
}
}