Hello everyone.
I'm having trouble analyzing date for the "dd / mm / yyyy" format.
I'm using the "Date Filter". Everything works perfectly for any date, except for "10/16/2016". Yes, it sounds quite weird, but I have tested several approaches (including "%{DATE_EU: DT_2}", without success.
I've been dealing with this all day. I was unable to locate information on any site or forum. Even here I found nothing.
We are thinking of changing the format to iso8086 when we build our csv file, but this will require a lot of effort. We need an index of 12 years of data and every year we have 1.4 billion documents. Changing each date (a single document has 6 date fields) will cost us a lot of time.
That is very strange. I was wondering if you might have some strange character in your file that caused this, but if you got the same failure while copying the example I provided that can not be the case. I have no issues running that example at all on my laptop.
Yep ... very strange. I've tried your sample on both my computer and server with the same strange result. Why this specific date? I have not tried every possible date, but in our example file, which has 6.2 million records, only that date caused failure.
Where can I get help? How to debug this date filter?
I guess I know what's going on: In your countries daylight saving time starts and ends at midnight.
16/10/2016 is 16/10/2016 00:00:00 and therefore doesn't exist: https://www.timeanddate.com/time/change/brazil/sao-paulo?year=2016
Sonntag, 16. Oktober 2016, 00:00:00 clocks were turned forward 1 hour to
Sonntag, 16. Oktober 2016, 01:00:00 local daylight time instead.
I tested the first case with timezone => "America/Sao_Paulo"
Nice catch! I changed my example as seen below and it worked just fine... I wonder if that would be the "cleanest" way to solve this issue (shouldn't the "timezone" attribute help here? I had no luck with it...).
Anyway... Vielen Dank und "Obrigado" aus Brasilien!
Hi Flávio.
The best way I could find to solve this issue with daylight is setting timezone to "Etc/GMT", like this:
date {
match => [ "DT_1", "dd/MM/yyyy" ]
target => "DT_2"
timezone => "Etc/GMT"
}
Thus, the date "16/10/2016" becomes "2016-10-16T00:00:00.000Z". This solved my problem, since I do not need the datetime, just the value as the date to perform some calculations.
I hope this can be useful for someone else, besides me.
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.