Logstash container: Cannot find jar driver library file for JDBC Input Plugin

I am using logstash container and I would like to use jdbc input plugin to read a remote mysql database.
I can see the plugin installed,

root@a547c877b6a4:/# /usr/share/logstash/bin/logstash-plugin list
...
logstash-input-jdbc
...
root@a547c877b6a4:/# 

But I cannot find the jar driver library to put in the configuration as instructed in the plugin repository:

input {
  jdbc {
    jdbc_driver_library => "/path/to/mysql-connector-java-5.1.33-bin.jar"   <<<<<<<
    jdbc_driver_class => "com.mysql.jdbc.Driver"
    jdbc_connection_string => "jdbc:mysql://host:port/database"
    jdbc_user => "user"
    jdbc_password => "password"
  # or jdbc_password_filepath => "/path/to/my/password_file"
    statement => "SELECT ..."
    jdbc_paging_enabled => "true"
    jdbc_page_size => "50000"
  }
}

From inside the container, nothing related to the wanted plugin:

root@a547c877b6a4:/# find / -name '*.jar' | grep -iE 'mysql|connector'
/usr/share/logstash/vendor/bundle/jruby/1.9/gems/ruby-maven-libs-3.3.9/maven-home/lib/aether-connector-basic-1.0.2.v20150114.jar
root@a547c877b6a4:/# 

Any hint?

But you have the jar file somewhere on the host machine don't you? Mount that location into the Docker container via the -v option to docker run.

2 Likes

Thanks @magnusbaeck,
Indeed, I downloaded the file separately and mounted the directory.
Now it works!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.