I am trying to overwrite @timestamp field value with date and time field values that come from the csv file. but i am getting document timestamp in the @timestamp field.
It does not seem that it is stays the same since it is not using the current time, it looks like that it got the 2022-07-31 00:00:00 time and shifted it by 4:30 hours, this would happen if you are in the timezone of UTC+04:30 and your Logstash is configured to use this timezone.
In which timezone are you in? And what is the timezone of your date time?
All dates in logstash and elasticsearch will always be in UTC, if your log time is not in UTC you need to explicitly configure the timezone in the date filter.
It would be something like this example:
date {
match => ["ndate", "yyyy-MM-dd HH:mm:ss"]
target => "@timestamp"
timezone => "+0430"
remove_field => "ndate"
}
In this case I'm telling Logstash that the value of the ndate field is a date and time from a timezone with UTC+04:30.
Hello @leandrojmp,
Yes i am in zone UTC+04:30 which is the zone for the date and time fields in my csv file.
I have explicitly configure the timezone in the date filter but still the @timestamp date is not as it is there in ndate field. plz see the below output:
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.