Logstash mysql/mariadb jdbc connection error

Hi,

I'm struggling with connection to mariadb DB from logstash.
Database is hosting on AWS.
When connecting manualy there is no problem, but when using logstash I'm getting :

"[2019-03-11T09:17:00,029][ERROR][logstash.inputs.jdbc ] Unable to connect to database. Tried 1 times {:error_message=>"Java::JavaSql::SQLRecoverableException: IO Error: Unknown host specified "}
[2019-03-11T09:17:00,085][ERROR][logstash.inputs.jdbc ] Unable to connect to database. Tried 1 times {:error_message=>"Java::JavaSql::SQLRecoverableException: IO Error: Unknown host specified "}
[2019-03-11T09:17:00,314][ERROR][logstash.inputs.jdbc ] Unable to connect to database. Tried 1 times {:error_message=>"Java::JavaSql::SQLException: Invalid Oracle URL specified"}
"

Config:

input {
jdbc {
jdbc_driver_library => "/etc/logstash/ojdbc/mysql-connector-java-8.0.11.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_connection_string => "jdbc:mysql://rds...:[PORT]/test"
jdbc_user => "monitor"
jdbc_password => "monitor"
schedule => "*/1 * * * *"

statement => "SELECT * from test;"

 }

}
}

Also tried with jdbc_connection_string => "jdbc:mysql:thin:@//rds...:[PORT]/dv_saas", but nothing changed.

We have also Oracle db, and the problem doesn't exists:

"jdbc {
jdbc_driver_library => "/etc/logstash/ojdbc/ojdbc8.jar"
jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
jdbc_connection_string => "jdbc:oracle:thin:@chg0005267...:[PORT]/test"
jdbc_user => "test"
jdbc_password => "test"
schedule => "*/10 * * * *"
...
}"

Any idea why it happens ?

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