I'm trying to inject MySQL data to Elasticsearch using Logstash.
This is my mysql table structure (id , datetime, value) where datetime consists if Unix Timestamp. ( example (131,1436298252,128) )
And here's the configuration file I wrote but doesn't work i.e It doesn't create an index with that Unix Timestamp in the database but with real timestamps.
input {
jdbc {
jdbc_connection_string => "jdbc:mysql://localhost:3306/test"
jdbc_user => "root"
jdbc_password => "root"
jdbc_driver_library => "/usr/share/java/mysql-connector-java-5.1.38.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
statement => "SELECT * from utinyintparamvalues"
}
}
filter {
date {
match => [ "datetime", "MMM dd yyyy HH:mm:ss","MMM d yyyy HH:mm:ss", "ISO8601" ]
}
}
output {
stdout { codec => json_lines }
elasticsearch {
hosts => "localhost:9200"
index => "testts"
document_type => "datatest"
}
}
How can I get it to use the timestamps from my database.? Thank you for your help.