Skip to content

Instantly share code, notes, and snippets.

@imamdigmi
Created August 29, 2017 06:51
Show Gist options
  • Select an option

  • Save imamdigmi/86fefc019ce49c5dd49b388641d4df68 to your computer and use it in GitHub Desktop.

Select an option

Save imamdigmi/86fefc019ce49c5dd49b388641d4df68 to your computer and use it in GitHub Desktop.
logstash
input {
jdbc {
jdbc_driver_library => "/home/idiot/Backup/EL/mysql-connector-java-5.1.43/mysql-connector-java-5.1.43-bin.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_connection_string => "jdbc:mysql://localhost:3306/ijak"
jdbc_user => "root"
jdbc_password => "idiot"
schedule => "* * * * *"
statement => "SELECT * FROM books WHERE created > :sql_last_value ORDER BY created"
use_column_value => true
tracking_column => created
}
tcp {
port => 5000
}
}
output {
stdout { codec => json_lines }
elasticsearch {
hosts => "localhost:9200"
index => "books"
document_type => "data"
document_id => "%{books_id}"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment