Sample Header Ad - 728x90

Use data from Mysql to ElasticSearch with Logstash

0 votes
1 answer
263 views
I'm using logstash for use my mysql database in ElasticSearch My conf is the next.
`
input {
    jdbc {
        jdbc_connection_string => "jdbc:mysql://[ip]:3306/nextline_dev"
        jdbc_user => "[user]"
        jdbc_password => "[pass]"
        #schedule => "* * * * *"
        #jdbc_validate_connection => true
        jdbc_driver_library => "/path/mysql-connector-java-6.0.5.jar"
        jdbc_driver_class => "com.mysql.cj.jdbc.Driver"
        statement => "SELECT * FROM Account"
    }
}
output {
    elasticsearch {
        index => "account"
        document_id => "%{id}"
        hosts => ["127.0.0.1:9200"]
    }
}
` But I have some questions, I want to schedule more than one query, but the index will be always account. Can I make a dynamic index for the output to elasticsearch? And how can I use more than one statement? (Export more than one table)
Asked by BlueSeph (121 rep)
Mar 15, 2019, 08:29 PM
Last activity: May 20, 2025, 03:02 PM