Why i am getting the time variation while overriding the @timestamp with logdate
My input: INFO | jvm 1 | 2019/05/06 23:39:05.254 | FileName:xxxx_20190506 File Size:4096 File Collection time:2019-05-06 23:39:05.181
INFO | jvm 1 | 2019/05/06 23:39:05.254 | FileName:xxxx_1526726694_15_201904071415_201904071430.csv File Size:6897823 File Collection time:2019-05-06 23:39:05.183
my stdout:
filesize" => "13140176",
"message" => "INFO | jvm 1 | 2019/05/07 06:13:08.498 | FileName:xxxx_1526726660_15_201905061330_201905061345.csv File Size:13140176 File Collection time:2019-05-07 06:13:08.458",
"path" => "/usr/data/test.log",
"file_collection_time" => "2019-05-07 06:13:08.458",
"@timestamp" => 2019-05-07T10:13:08.498Z,
"host" => "localhost.localdomain",
"@version" => "1",
"logdate" => "2019/05/07 06:13:08.498",
"Filename" => "xxxxx_1526726660_15_201905061330_201905061345"
my config file:
input {
stdin{}
}
filter {
if "pmexport" in [message] {
grok {
match => { "message" => "%{WORD:LogLevel}%{SPACE}%{NOTSPACE}%{SPACE}%{WORD}%{SPACE}%{NUMBER}%{SPACE}%{NOTSPACE}%{SPACE}(?<logdate>%{YEAR}/%{MONTHNUM}/%{MONTHDAY} %{HOUR}:%{MINUTE}:%{SECOND})%{SPACE}%{NOTSPACE}%{SPACE}FileName:%{WORD:Filename}%{SPACE}File Size:%{INT:filesize}%{SPACE}File Collection time:%{TIMESTAMP_ISO8601:file_collection_time}"}
}
}
else {
grok {
match => { "message" => "%{WORD}%{SPACE}%{NOTSPACE}%{SPACE}%{WORD}%{SPACE}%{NUMBER}%{SPACE}%{NOTSPACE}%{SPACE}(?<logdate>%{YEAR}/%{MONTHNUM}/%{MONTHDAY} %{HOUR}:%{MINUTE}:%{SECOND})%{SPACE}%{NOTSPACE}%{SPACE}FileName:%{WORD:Filename}.%{WORD}%{SPACE}File Size:%{INT:filesize}%{SPACE}File Collection time:%{TIMESTAMP_ISO8601:file_collection_time}"}
}
}
date {
match => ["logdate","yyyy/MM/dd HH:mm:ss.SSS"]
target=> "@timestamp"
locale => "en"
timezone => "America/New_York"
}
}
output {
stdout { codec => rubydebug }
}