Hi,
we have some logfiles which contain three different timestamp formats.
Example:
[02/Mar/2018:09:35:21] [Info] [Module] [3085] [Function] my message
[Fri Mar 02 09:35:21.474812 2018] [Module] [pid 1819:tid 140437688055616] errorcode: caught SIGTERM, shutting down
[02/Mär/2018:09:35:25] [Info] [Module] [19154] [Function: message]
The timestamp is always contained in the field "timestamp", extracted using a grok pattern.
I've tried the following:
date { match => [ "timestamp", "dd/MMM/yyyy:HH:mm:ss" ] # 02/Mar/2018:09:35:21 locale => [ "en-US" ] } date { match => [ "timestamp", "dd/MMM/yyyy:HH:mm:ss" ] # 02/Mär/2018:09:35:25 locale => [ "de-DE" ] } date { match => [ "timestamp", "EEE MMM dd HH:mm:ss.SSSSSS yyyy" ] # Fri Mar 02 09:35:30.052734 2018 }
The problem is: I get dateparsefailure on all three lines. How to get rid of those? The timestamps themselves are correctly parsed.
What would be the correct way to handle such special logfiles?..
Thanks
Bernhard