Logstash date filter parsing year that is greater than 4 digits

With a logstash filter like this:
date {
match => [ "logdate", "YYYY-MM-dd HH:mm:ss" ]

and the value of logdate being 12019-06-17 15:09:16

I would expect the date filter to fail the match, as there are 5 digits. But logstash date filter is accepting and creating a timestamp like this:

"@timestamp" => 12019-06-17T15:09:16.000Z,

It seems to accept any number of digits in the year (1...n) where I checked upto 7 digits.

I feel this is a bug, since the format provided is specifically 4 digits ("yyyy" or "YYYY").

How do we ensure that the date is validated to be valid date by logstash date filter match? where it should not match those invalid dates.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.