Parsing date format error


(Khaled Saidi) #1

Hi everybody,

I'm facing an issue that drive me crazy.
I have a date field in my log file like :

2018-09-21T14:01:59.271245+02:00

In my logstash filter i tried a lot of pattern and the last one is:

date {
      match => ["datetime", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd'T'HH:mm:ss.SSSSSSZZ", "ISO8601"]
}  

But it does not work....

Does anyone have any ideas please ?

Thx for your help.


(Khaled Saidi) #2

Hi,

No answer yet...
Nobody have to deal with this kind of format ?


(Guy Boertje) #3

It works for me:

input {
  generator {
    lines => ['2018-09-21T14:01:59.271245+02:00']
    count => 1
  }
}

filter {
  date {
    match => [ "message", "yyyy-MM-dd'T'HH:mm:ss.SSSSSSZ"]
  }
}

output {
  stdout { codec => rubydebug }
}

Result:

{
      "sequence" => 0,
          "host" => "Elastics-MacBook-Pro.local",
      "@version" => "1",
    "@timestamp" => 2018-09-21T12:01:59.271Z,
       "message" => "2018-09-21T14:01:59.271245+02:00"
}

(system) #4

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