Hi I am trying to migrate data from mysql to ELastic Search. But in es time is getting changed.
in mysql (2017-07-20 16:42:07) to (2017-07-20T11:12:07.000Z) in es .
following is my logstash.conf
input {
jdbc {
-- jdbc connection details --
jdbc_driver_class => "com.mysql.jdbc.Driver"
statement => "SELECT * FROM table"
jdbc_paging_enabled => true
jdbc_page_size => 5000
jdbc_default_timezone => "Asia/Kolkata"
}
}
filter {
date {
locale => "en"
timezone => "Asia/Kolkata"
match => ["created_at","yyyy-MM-dd'T'HH:mm:ssZ","ISO8601"]
target => "created_at"
}
}
output {
stdout { codec => json_lines }
elasticsearch {
"hosts" => ["aa.bb.cc.dd:9200"]
"index" => "xyzz"
"document_type" => "_doc"
"document_id" => "%{id}"
}
}
PS there are multiple date filed in same table. How to specify time zone at table level instead of per field.