I know that there are tons of topics on this subject, but the only ones that I found didn't work for me.\
I have a date field with a date and time that has to be converted in Logstash to the UTC value.
I tried lots of things, like the snippet below, but didn't work:
date {
match => ["record_date", "YYYY-MM-dd'T'HH:mm:ss.SSSSSSZ"]
timezone => "UTC" #target => "record_date"
}
The output from that (with or without the target), has the same date time value as it was provided. How can I change the time to the equivalent UTC time?
timezone should be set to the timezone that the datetime is currently in, not the one you want to be changed to. That configuration tells logstash the datetime is already in UTC, so it will not be changed.
Thanks for the reply. The problem is that the data is coming from JMS and the date was supposed to be persisted in UTC (requirement). The timestamp is actually in UTC, but not one of the incoming dates, so I have to convert to UTC in the record, before the elasticsearch output.
Thanks,
Rob
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.