Hi,
I need to replace my log timestamp with logstash @timestamp.I have tried all possible ways and time formats but still not able to replace it and getting dateparsefailure issue every time.
Can anybody help me to sort out this?
Thanks in advance.
One line of my log sample is:
[ERROR@[140598203889408]2018-01-23 06:43:48.798511 in src/TMSInfo.cpp(1699)]TMSInfo::GetCorrelationKey: CIN is NULL failed to create corr key based on cin
Did you try a date pattern ending with SSSSSS to capture the microseconds? I'm not sure that's supported so if it doesn't work you might have to cut them off with a mutate filter. What's printed by the stdout { codec => rubydebug } output?
Hi,I tried,but did not work out.
The output is like as below:
{
"path" => "x:\x\x\x.log",
"@timestamp" => 2018-04-09T12:08:27.328Z,
"@version" => "1",
"host" => "CT-IL0004",
"message" => "",
"tags" => [
[0] "_grokparsefailure"
]
}
Your grok cuts off the start of the timestamp, so it's actually 'yy', but Magnus' 'SSSSSS' suggestion works fine for me. The pattern "yy-MM-dd HH:mm:ss.SSSSSS" results in:
"msg" => "18-01-23 06:43:48.798511",
"@timestamp" => 2018-01-23T05:43:48.798Z,
"testmsg" => "[ERROR@[140598203889408]2018-01-23 06:43:48.798511 in src/TMSInfo.cpp(1699)]TMSInfo::GetCorrelationKey: CIN is NULL failed to create corr key based on cin"
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.