In order for me to link my mysql database with elasticsearch, I need the jdbc plugin with logstash.
Where/how do I install this plugin and how do I use it?
The JDBC input plugin is installed by default with modern versions of Logstash, but you may need to install a driver.
To do so, download the appropriate JDBC driver to the local filesystem of your Logstash host, and point to it in your pipeline configuration:
The MySQL driver is available for download here.
Once it is on the Logstash machine's filesystem, you can reference it with the JDBC Input Plugin's jdbc_driver_library
and jdbc_driver_class
directives:
input {
jdbc {
"jdbc_driver_library" => "/path/to/mysql/driver.jar"
"jdbc_driver_class" => "com.mysql.jdbc.Driver"
}
}
Thank you. And the jdbc connection string should be pointing toward my localhost of mysql?
If your mysql is hosted on the same machine, and is bound to local interfaces, then yes.
If your machine is hosted on a different machine, the connection string will need to reference it.
I found the MySQL docs for it here: https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-jdbc-url-format.html
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.