Hi there,
I've been trying to get logstash to connect to a mariadb instance without any luck. My config is pretty basic with:
input {
jdbc {
jdbc_connection_string => "jdbc:mariadb://192.168.40.202:3306/munkireport"
jdbc_user => "munkireport"
jdbc_password => "munkireport"
jdbc_driver_library => "/opt/jdbc/mariadb-java-client-2.2.3.jar"
jdbc_driver_class => "org.mariadb.jdbc.Driver"
statement => "SELECT serial_number, hostname, os_version FROM `munkireport`.`machine`;"
}
}
And is returning the following error when trying to connect:
[2018-04-09T14:19:52,815][ERROR][logstash.pipeline ] A plugin had an unrecoverable error. Will restart this plugin. Pipeline_id:main Plugin: <LogStash::Inputs::Jdbc jdbc_connection_string=>"jdbc:mariadb://192.168.40.202:3306/munkireport", jdbc_user=>"munkireport", jdbc_password=><password>, jdbc_driver_library=>"/opt/jdbc/mariadb-java-client-2.2.3.jar", jdbc_driver_class=>"org.mariadb.jdbc.Driver", statement=>"SELECT serial_number, hostname, os_version FROM `munkireport`.`machine`;", id=>"ede5f6baf9ecbff57b0f5af0185955f9dd528a8c3bd8be3bd7963b2e24e9fd9f", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_c3797e2f-3e5a-4806-9eed-a76c4772cf1b", enable_metric=>true, charset=>"UTF-8">, jdbc_paging_enabled=>false, jdbc_page_size=>100000, jdbc_validate_connection=>false, jdbc_validation_timeout=>3600, jdbc_pool_timeout=>5, sql_log_level=>"info", connection_retry_attempts=>1, connection_retry_attempts_wait_time=>0.5, parameters=>{"sql_last_value"=>1969-12-31 18:00:00 -0600}, last_run_metadata_path=>"/usr/share/logstash/.logstash_jdbc_last_run", use_column_value=>false, tracking_column_type=>"numeric", clean_run=>false, record_last_run=>true, lowercase_column_names=>true> Error: Java::JavaSql::SQLException: No suitable driver found for jdbc:mariadb://192.168.40.202:3306/munkireport Exception: Sequel::DatabaseConnectionError Stack: java.sql.DriverManager.getConnection(java/sql/DriverManager.java:689)
I've successfully tested the connection from another machine, so I know the permissions and access are correct for the connection to the database.
Is there anything else I can check or a sample config others have working connecting to a mariadb via the jdbc connection?