How to convert yyyyMMddHHmmssSSSZ string into timestamp

Hi ,

I want to convert date string yyyyMMddHHmmssSSSZ to timezone , I have tried with
date {
match => ["datetime", "YYYYMMddHHmmssSSS" ]
target => "datetime"
}
but i am getting _dateparsefailure in tags.

How to convert this?

Hard to say without an example.
Anyway I moved your question to #logstash

Hi ,

Sample log statement is : [INFO] SYSLOG->|datetime:20190218142929801+0530|hostname:ABCD

What is in the field datetime?

datetime is string field

What exactly are the contents of the string field?

Datetime field having datetime in this format yyyyMMddHHmmssSSSZ

If it has that format then

date { match => [ "datetime", "yyyyMMddHHmmssSSSZ" ] }

will parse it.

getting _dateparsefailure tag

Then it does not have the format that you claim it has. Given that you have not shown us the data there is nothing else I can do to help.

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