Logstash connection with Oracle wallet

Hello,

I'm having issues connecting Logstash using Oracle wallet. I am getting an invalid login/password even though I am trying to connect through the wallet, without using said login/password.

[ERROR][logstash.inputs.jdbc ] Unable to connect to database. Tried 2 times {:error_message=>"Java::JavaSql::SQLException: ORA-01017 Invalid Username/Password"}

Here's my Logstash jdbc input file :

input {
    jdbc {
        jdbc_driver_library => "${ORACLE_HOME}/dmu/jlib/ojdbc10.jar,${ORACLE_HOME}/ucp/lib/ucp.jar,${ORACLE_HOME}/jlib/oraclepki.jar,${ORACLE_HOME}/jlib/osdt_cert.jar,${ORACLE_HOME}/jlib/osdt_core.jar"
        jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
        jdbc_connection_string => "jdbc:oracle:thin:/@name_high?TNS_ADMIN=${ORACLE_HOME}/network/admin/wallet"
        jdbc_user => ""
        schedule => "* * * * * *"
        statement => "SELECT * from table"
        connection_retry_attempts => 2
        connection_retry_attempts_wait_time => 5
        jdbc_pool_timeout => 20
        jdbc_validation_timeout => 600
    }
}

So I use the following drivers :

  • ojdbc10.jar
  • ucp.jar
  • oraclepki.jar
  • osdt_cert.jar
  • osdt_core.jar

I made sure every environement variable paths are correct, every access rights correctly set.
I believe the connection string syntaxe is correct since it does find the tnsnames.ora and attempt a connexion to the right host, port, sid.
I omitted the field jdbc_password in the jdbc input as it is not required and I don't want jdbc to think I want to use it. I left the jdbc_user field but empty as it is apparently required even though I'm trying not to use it.
I'm able to connect to the database using sqlplus as follow :

sqlplus /@name_high

So I am at my wit's end (however short that is). If anyone is able to point out what I am missing, I would be immensely grateful !

I don't think this is supported.

There is an old issue about it, but it still open.

Thanks for the response !

I agree that it does seems to be something of a mythical feature. I have great difficulties findind any specific documentation or information. But on that topic discuss.elastic the asker seems to have made it work which gives me hope.
I don't want to say that it's not feasible if there is a chance.

If anyone's in the same situation, know that what I was missing is the wallet_location VM property.
I had to set en environement variable as such :

export LS_JAVA_OPTS="-Doracle.net.wallet_location=(SOURCE=(METHOD=FILE)(METHOD_DATA=(DIRECTORY=${TNS_ADMIN})))"

That works too but this is not what's in Oracle doc :

export LS_JAVA_OPTS="-Doracle.net.wallet_location=${TNS_ADMIN}"

And be sure that the script launching Logstash is passing it as VM environement variable.

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