Convert Date String Into Date Format

Hi,

I want to convert a date which is like this :
2020-09-18 15:42:41.5721

To do so, I have tried to use date plugin but it seems that it doesn't work. I have this _dateparsefailure and my @timestamp hasn't changed

    date {
		match => [ "time_stamp", "yyyy-MM-dd HH:mm:ss.SSS"]
	}

I've also tried to match with "ISO8601" as I read time_stamp like this :
%{TIMESTAMP_ISO8601:time_stamp}.
Of course I've checked and it contains 2020-09-18 15:42:41.5721.

Can anyone help me ?

Thanks

I found a solution :
I deleted the date filter and y added this to my mutate filter :

        gsub => [
                  "timestmp", " ", "T"
                ]

It's automatically converted as date type then

The reason that does not work is because you have 4 digits sub-second. It would work if you used

match => [ "time_stamp", "yyyy-MM-dd HH:mm:ss.SSSS"]

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