Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- input{
- jdbc {
- jdbc_driver_library => "/home/user/logstash/mysql-connector-java-5.1.17-bin.jar"
- jdbc_driver_class => "com.mysql.jdbc.Driver"
- jdbc_connection_string => "jdbc:mysql://[remotehostipnumber]/databasename"
- jdbc_validate_connection => true
- jdbc_user => "username"
- jdbc_password => "password"
- schedule => "* * * * *"
- statement => "select * from table"
- }
- }
- output
- {
- elasticsearch
- {
- index => "tables"
- document_type => "table"
- document_id => "%{table_id}"
- hosts => "localhost:9200"
- }stdout { codec => json_lines }
- }
- sudo /opt/logstash/bin/logstash --configtest -f /home/user/logstash/logstash.conf
- Settings: Default filter workers: 1
- Logstash startup completed
- curl -XGET 'localhost:9200/tables/table/_search?pretty=true'
- {
- "error" : {
- "root_cause" : [ {
- "type" : "index_not_found_exception",
- "reason" : "no such index",
- "resource.type" : "index_or_alias",
- "resource.id" : "tables",
- "index" : "table"
- } ],
- "type" : "index_not_found_exception",
- "reason" : "no such index",
- "resource.type" : "index_or_alias",
- "resource.id" : "tables",
- "index" : "tables"
- },
- "status" : 404
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement