JDBC connects to different ip as configured

The logstash-input-jdbc plugin ignores my server ip which it should connect to.

I'm running Logsasth 6.2.2 in docker and added the MariaDB Java Client v2.2.3 to it. I also tried the MySQL Connect Java 5.1.36 but got the same issue.

Config

input {
  jdbc {
    jdbc_connection_string => "jdbc:mariadb://213.201.98.188:6000/vrp_public_logs"
    jdbc_user => "MegaThorx"
    jdbc_password => "password"
    jdbc_validate_connection => true
    jdbc_driver_library => "/usr/share/logstash/logstash-core/lib/jars/mariadb-java-client-2.2.3.jar"
    jdbc_driver_class => "org.mariadb.jdbc.Driver"
    statement => "SELECT * FROM vrpLogs_Kills"
  }
}

Error from logstash

logstash_1       | [2018-03-28T06:15:47,900][ERROR][logstash.pipeline        ] A plugin had an unrecoverable error. Will restart this plugin.
logstash_1       |   Pipeline_id:main
logstash_1       |   Plugin: <LogStash::Inputs::Jdbc jdbc_connection_string=>"jdbc:mariadb://213.201.98.188:6000/vrp_public_logs", jdbc_user=>"MegaThorx", jdbc_password=><password>, jdbc_validate_connection=>true, jdbc_driver_library=>"/usr/share/logstash/logstash-core/lib/jars/mariadb-java-client-2.2.3.jar", jdbc_driver_class=>"org.mariadb.jdbc.Driver", statement=>"SELECT * FROM vrpLogs_Kills", id=>"a1c0dc9a18680d9aeacc058cced8642552b50551ae45d1c62ea34af5dfd58d84", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_2784196e-7300-499f-910e-1191871096a1", enable_metric=>true, charset=>"UTF-8">, jdbc_paging_enabled=>false, jdbc_page_size=>100000, 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"=>1970-01-01 00:00:00 UTC}, 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>
logstash_1       |   Error: Java::JavaSql::SQLInvalidAuthorizationSpecException: Access denied for user 'MegaThorx'@'192.168.122.10' (using password: YES)
logstash_1       |   Exception: Sequel::DatabaseConnectionError
logstash_1       |   Stack: org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(org/mariadb/jdbc/internal/util/exceptions/ExceptionMapper.java:173)

The logstash-input-jdbc plugin ignores my server ip which it should connect to.

What makes you say that? The logs indicate that it's trying to connect to 213.201.98.188 as configured. Isn't 192.168.122.10 your IP address?

Thanks I was so confused by this line that I didn't checked the credentials. I forgot that the username is case sensitive and that was the problem in the end.

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