Jdbc connection to mariadb connection issue

Hi,

I am using jdbc_streaming filter plugin to connect to mariadb and pull data . I am getting the below error in logstash logs

[WARN ][logstash.filters.jdbcstreaming] Exception when executing JDBC query {:exception=>#<Sequel::DatabaseDisconnectError: Java::JavaSql::SQLNonTransientConnectionException: (conn=165868) Broken pipe (Write failed)>}

these are my connection parameters

        jdbc_user => "xxx"
        jdbc_password => "xxx"
        jdbc_driver_class => 'org.mariadb.jdbc.Driver'
        jdbc_driver_library => '/apps/logstash/mariadb-java-client-2.5.4.jar'
        jdbc_connection_string => "jdbc:mariadb://zzzz.com:3306/xxxxx"
        statement => "select device_name,sitetype,osversion,model,bldg from table where 
        device_name=:device"
        parameters => {"device" => "[hostname]"}
        target => "device_info"
        cache_expiration => 86400.0
        cache_size => 10000000
        use_cache => true
        tag_on_default_use => [ ]
        jdbc_validate_connection => true

any other connection parameters I can use to fix the connection issue ?

@annk -

  1. Was your Logstash pipeline working before?

  2. Could you run Logstash with debug logging and send the debug logs to us? For example:

  • bin/logstash --debug -f <PATH_TO_CONFIG_FILE>

Thank you.

  1. We recently started using mariadb, it was working fine with postgres.
    Currently restarting logstash fixes the issue, I thought enabling jdbc_validate_connection will fix the issue but it didnt.

  2. I will try that

1 Like

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