Hi, I understand this might be a very common question asked but I couldn't find any answer that addressed my issue.
Here it goes. I have a log message as shown below that I am publishing from Filebeats into Logstash.
20170128 144622.584437 0005B9427CA0_CU_1 user.info sometext.
Problem: The timestamp used is still the current one and not corresponding to the log message.
I have defined a filter as below:
filter {
date {
match => ["timestamp" , "yyyyMMdd HHmmss.SSS"]
target => "@timestamp"
add_field => { "debug" => "timestampMatched"}
}
}
Logstash log messages:
[2017-07-17T12:58:42,473][DEBUG][logstash.pipeline ] filter received {"event"=>{"@timestamp"=>2017-07-17T07:28:41.042Z, "offset"=>746730, "@version"=>"1", "beat"=>{"hostname"=>"node1", "name"=>"node1", "version"=>"5.5.0"}, "input_type"=>"log", "host"=>"node1", "source"=>"/root/samplelogs/Debug.log", "message"=>"20170128 144622.584437 0005B9427CA0_CU_1 user.info sometext", "type"=>"log", "tags"=>["beats_input_codec_plain_applied"]}}
[2017-07-17T12:58:42,473][DEBUG][logstash.pipeline ] output received {"event"=>{"@timestamp"=>2017-07-17T07:28:41.042Z, "offset"=>746730, "@version"=>"1", "beat"=>{"hostname"=>"node1", "name"=>"node1", "version"=>"5.5.0"}, "input_type"=>"log", "host"=>"node1", "source"=>"/root/samplelogs/Debug.log", "message"=>"20170128 144622.584437 0005B9427CA0_CU_1 user.info sometext", "type"=>"log", "tags"=>["beats_input_codec_plain_applied"]}}
What seems to be the issue here? Is the timestamp format missing something?
-Thanks
Nikhil