I have an index spoms-audit-2022.08.04 in which there are 4 documents. When I search them from the dev console, i am able to see all the documents.
Below is the search query:
Pretty sure you are loading your time with out timezone so it is in the future.
Also when you show text please paste as text not screen shot... some people can not see the images and the can not be searched or debug... example I could not cut-paste your date
I'm updating the timestamp using the logstash filter, Is there any way I can tell it this time is in IST?
@stephenb I figured out the setting that I need to change... Thanks a lot!! We were stuck on this for about a week now..Thanks a lot for your help. You rock
@Arjun_Meena
OK good community is to not post screen shot... and if you do have a solution you should post that for others to benefit from.. you say you solved it but did not show.. please do so the next person can learn from you!
The timestamp of my logs was in the local timezone (IST). I was picking the timestamp from my logs and overwriting it to the @timestamp field using logstash date filter plugin. I didn't specify any timezone setting there, so elasticsearch is taking that @timestamp as UTC and converting it to our local time zone, making them 5:30 hours ahead of their actual time.
So a log with an original timestamp of August 4th, 2022 20:40:58.364 (IST) would be shown in the discover tab as August 5th, 2022 02:10:58.364.
All I had to do to fix this was basically specify the timezone of the logs in the date filter plugin, so the elasticsearch would know that the logs timstamp are already in the IST timezone, and it doesn't need to add any offset.
Below is the working logstash config:
#Update the timestamp with the timestamp present in the log
date {
match => ["timestamp", "dd-MM-yyyy'T'HH:mm:ss.SSS"]
target => "@timestamp"
timezone => "Asia/Kolkata"
}
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.