我正在从 couchdb 日志中解析时间戳。在 stdout 中查看时,整个时间戳得到正确处理,但是在 elasticsearch 之上使用 Kibana 查看时会观察到 _grokparsefailure。
前日志:
[Thu, 31 Jul 2014 17:14:28 GMT] [info] [<0.23047.647>] 10.30.50.48 - - HEAD /z_775-797_api_docs 200
我在解析日期格式时遵循了这些链接:http: //logstash.net/docs/1.4.2/filters/date,http : //joda-time.sourceforge.net/apidocs/org/joda/time/格式/日期时间格式.html
我的解析代码是:
grok{
match => { "message" => "%{SYSLOG5424SD:Log_Time} \[info] %{SYSLOG5424SD:response_time} %{IPV4:ip_address} - - %{WORD:http_method} %{URIPATH} %{INT:file_value}" }
}
date{
match => ["Log_Time","[EEE, dd MMM YYYY HH:mm:ss zzz]"]
}
我的输出代码是:
output {
elasticsearch { host => localhost }
stdout { codec => json }
}
其中 Log_Time =[Thu, 31 Jul 2014 17:14:28 GMT]
输出时间戳为
"@timestamp":"2014-07-31T17:14:28.000Z"
标准输出下显示的数据是 "@timestamp":"2014-07-31T17:14:28.000Z" 没有任何 grok 解析错误,但在 Kibana 中,解析时间以时间戳的形式出现,并且存在 _grokparseerror 标签。我不明白为什么标准输出和 Kibana 之间存在这种差异。我尝试删除所有弹性搜索索引和 .sincedb 文件,但仍然存在错误。
如果您有任何想法,请提供帮助