Created
January 27, 2019 11:53
-
-
Save fatmali/c860f6046f821208a9af55bec49928c9 to your computer and use it in GitHub Desktop.
A logstash config file for ingesting data from MySQL table into Elasticsearch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
jdbc { | |
jdbc_connection_string => "jdbc:mysql://localhost:3306/testdb" | |
# The user we wish to execute our statement as | |
jdbc_user => "root" | |
jdbc_password => "123456" | |
# The path to our downloaded jdbc driver | |
jdbc_driver_library => "/home/comp/Downloads/mysql-connector-java-5.1.38.jar" | |
jdbc_driver_class => "com.mysql.jdbc.Driver" | |
# our query | |
statement => "SELECT * FROM testtable" | |
} | |
} | |
output { | |
stdout { codec => json_lines } | |
elasticsearch { | |
"hosts" => "localhost:9200" | |
"index" => "test-migrate" | |
"document_type" => "data" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment