Best way to handle different date formats?


I have a a bunch of .csv files but the providing party has been nice enough to use a different date format on just about every file...

Apart from using lots of if statements, is there a more practical way to have the date filter apply the date in the .csv as @timestamp?

The date format varies between yyyy/mm/dd hh:mm:ss, dd/mm/yyyy hh:mm:dd, d/mm/yyyy h:mm:ss am/pm etc.

The "match" option on the date filter Logstash plugin takes an array input. This means you could have multiple date patterns with just one date filter in your config file. There are examples of this in the logstash documentation here.

1 Like

Thanks. Complete read over the fact match functions as an array.

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