Hi, I am trying to configure logstash file which will replace the logstash read timestamp or system time with actual log time. In the kibana discover dashboard logs are displayed with logstash read time. How to replace this logstash read time. with actual log time.
When you add a target it takes that value and puts it into that field. If you remove the target then it will put it in @timestamp. It sounds like you are looking to do this.
filter{
date {
match => [ "msg_timestamp", "yyyy-MM-dd'T'HH:mm:ss','SSS" ]
}
}
Thanks for the quick response. I tried what is suggested it did not work.
the output
' {
"message" => "2021-05-01T18:01:46,993 | ITM-TunnelInventoryState,REMOVE DTCN received for tun4fdba39c604",
"host" => "IN-00211777",
"type" => "event",
"@timestamp" => 2021-10-04T16:44:54.778Z,
"@version" => "1",
"path" => "C:/Users/eaampnr/ELK/elk/csi/cic-1/log/events/genius/genius.log"
}
'
My expectation of output is below
{
"message" => "2021-05-01T18:01:46,993 | ITM-TunnelInventoryState,REMOVE DTCN received for tun4fdba39c604", --- i want to remove the timestamp from the log messages
"host" => "IN-00211777",
"type" => "event",
"@timestamp" => 2021-05-01T18:01:46,993, ----- it must be the log timestamp
"@version" => "1",
"path" => "C:/Users/eaampnr/ELK/elk/csi/cic-1/log/events/genius/genius.log"
}
I was thinking you didn't post your entire conf but as @badger pointed out you aren't processing your message. You will need to parse your message field to break it down into individual fields before you use them. One method you can use is grok.
Something like this before you use the msg_timestamp field.
{
"msg": "ITM-TunnelInventoryState,REMOVE DTCN received for tun4fdba39c604",
"msg_timestamp": "2021-05-01T18:01:46,993",
"@timestamp": " 2021-05-01T22:01:46.993Z" <--- adjusted for timezone that's saved in Zulu time
}
thank you for the inputs. I used the 'timestamp' instead of 'msg_timestamp'. But still I see the below output. Log timestamp is not overriding in the output.
Thank you for config. the filter file you provided is working fine. The only change required is the "timestamp" to be in the same time zone of msg_timestamp.
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.