Hi everybody,
I have a problem while I try to convert a string variable to timestamp.
I'm using date module without successful result. Format date is dd/MM/yyyy hh:mm:ss.SSSSSS and originally the variable newDate is:
"logLevel" => "DEBUG4:",
"strangeElement" => "elk1",
"newMessage" => "DelayedCollectionPolicy.getNextFile()=null",
"newDate" => "04/02/2023 00:53:00.006357"
And I tried to use match next way, but not workwed:
date {
match => [ "newDate", "dd/MM/yyyy hh:mm:ss.SSSSSS" ]
timezone => "America/Mexico_City"
target => "otherDate"
}
For that reason it came to my mind to split newDate variable ahead of applying the match, in order to get rid of six miliseconds, as I thought that six milliseconds were causing some conflict but neither worked too, as the match doesn't success.
"newDate" => [
[0] "04/02/2023 06:50:00",
[1] "007299"
],
date {
match => [ "[newDate][0]", "dd/MM/yyyy hh:mm:ss" ]
timezone => "America/Mexico_City"
target => "otherDate"
}
I tried to use different timezone, but neither works. Any suggestion?
Thanks.