i'm trying to parse a date like this one : 2017-04-29 00:00:00 +0200
I'm using this date filter : filter { date { match => [ "txechecczhier_date", "yyyy-MM-dd HH:mm:ss Z" ] } }
I'm getting a result like this {"txechecczhier_date":"2017-04-29 00:00:00 +0200","@version":"1","@timestamp":"2017-05-02T13:08:01.755Z","Name":"echec_cz_hier","tags":["_dateparsefailure"]}
What's wrong? could you say me why i'm getting a dateparsefailure please?
I tried it but i'm always getting this error message (in all cases) : Failed parsing date from field {:field=>"txechecczhier_date, : value=>#<Date: 2017-04-29 ((2457873j,0s,0n),0s,2299161j)), :exception=>"cannot convert instance of class org.jruby.RubyoObject to class java.lang.string", :config_parsers=>"ISO8601", : config_locale=>"default=fr_FR", :level=>:warn}
So if i understand, i have to create a grok pattern too? bacause in my case i need the txechecczhier_date and also the @timestamp which have differents values
No, you don't have to. It's just something that I have done to kinda avoid this date problem.
(You can keep both your timestamp, in my case I override it because I don't need it)
The problem might come from the timezone. Try to send some dummy log to see if the part without the timezone is correctly matched
I used stdin and send some data and i have this result : {"message":"2017-04-29 00:00:00 +0200\r","@version":"1","@timestamp":"2017-05-02T14:01:02.506Z","host":"HOME"} {"message":"2017-03-29 15:00:00 +0500\r","@version":"1","@timestamp":"2017-05-02T14:02:21.641Z","host":"HOME"} {"message":"2017-03-29 15:01:00 +0500\r","@version":"1","@timestamp":"2017-05-02T14:02:31.201Z","host":"HOME"}
And i'm getting this with the filter : {"message":"2017-04-29 00:00:00\r","@version":"1","@timestamp":"2017-05-02T14:06:36.545Z","HOME":"CD001603","tags":["_dateparsefailure"]} {"message":"2017-04-29 00:00:00\r","@version":"1","@timestamp":"2017-05-02T14:06:51.880Z","host":"HOME","tags":["_dateparsefailure"]}
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.