As you noticed there is a datetime field in my mysql table, and I want the values to be the same in elasticsearch, but when I use logstash to stream the data to elasticsearch, from Kibana interface, I can see the data
The stdout {codec => rubydebug} result shows:
It means datetime field value is correct.
Also if I use sense to query this document, it shows correct value
However, if I use Kibana discover to see the doc, the value of datetime field is 5 hours ahead of the time, it also happens in Kibana discover histogram.
However, if I use Kibana discover to see the doc, the value of datetime field is 5 hours ahead of the time, it also happens in Kibana discover histogram.
That's because Kibana by default adjusts the UTC timestamps in ES to the browser's local time. You can change this behavior via Kibana's advanced settings.
Thanks for your reply. The setting is already set to browser. And the problem still exists.
Because when I import from mysql using logstash, it recognises the datetime field as UTC, but my DB is using EST Timezone. So I need to tell logstash to acknowledge the field is EST. If not, there is time difference between my DB and elasticsearch.
I got it, I will convert the date field to UTC from mysql side, then it will solve the problem.
On Mysql side, the date is in ET time zone, I converted it to the UTC, then the problem is solved.
select CONVERT_TZ(datetime,'+00:00','+05:00') , field1, field2,... from mytable
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.