Hi,
I have a very strange behavior when parsing date. Does anybody understand this behavior?
Here the config:
input { stdin { codec => json} }
filter {
if [last_seen]{
date {
tag_on_failure => true
match => [ "last_seen", "dd.MM.YYYY HH:mm" ]
target => "@timestamp_last_seen"
}
}
}
output { stdout { codec => rubydebug } }
And here 3 examples:
{"last_seen": "31.03.2019 01:59"}
{
"host" => "example",
"@version" => "1",
"last_seen" => "31.03.2019 01:59",
"@timestamp" => 2019-05-20T13:47:47.855Z,
"@timestamp_last_seen" => 2019-03-31T00:59:00.000Z
}
{"last_seen": "31.03.2019 02:00"}
{
"host" => "example",
"tags" => [
[0] "true"
],
"@version" => "1",
"last_seen" => "31.03.2019 02:00",
"@timestamp" => 2019-05-20T13:48:00.090Z
}
why the above example failed??
If i change the day of the month from 31 to 30 it works again. But 31.03.2019 exists and the expected output should be only 1 minute different from the one in the first example.
{"last_seen": "30.03.2019 02:00"}
{
"host" => "example",
"@version" => "1",
"last_seen" => "30.03.2019 02:00",
"@timestamp" => 2019-05-20T13:48:36.551Z,
"@timestamp_last_seen" => 2019-03-30T01:00:00.000Z
}
Thx in advance