# Logstash connection with Oracle wallet

**URL:** <https://discuss.elastic.co/t/logstash-connection-with-oracle-wallet/319300>\
**Category:** Logstash\
**Tags:** jdbc\
**Created:** [November 18, 2022, 12:58pm UTC](https://discuss.elastic.co/t/logstash-connection-with-oracle-wallet/319300 "2022-11-18T12:58:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Num](https://avatars.discourse-cdn.com/v4/letter/n/db5fbb/32.png) [@Num](https://discuss.elastic.co/u/Num)\
**Post date:** [November 18, 2022, 12:58pm UTC](https://discuss.elastic.co/t/logstash-connection-with-oracle-wallet/319300/1 "2022-11-18T12:58:57Z")

</div>

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.

```auto
[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 :

```auto
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 !

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [November 18, 2022, 1:14pm UTC](https://discuss.elastic.co/t/logstash-connection-with-oracle-wallet/319300/2 "2022-11-18T13:14:15Z")

</div>

I don't think this is supported.

There is an [old issue](https://github.com/logstash-plugins/logstash-integration-jdbc/issues/113) about it, but it still open.

---

<div class="post-metadata">

**Author:** ![Num](https://avatars.discourse-cdn.com/v4/letter/n/db5fbb/32.png) [@Num](https://discuss.elastic.co/u/Num)\
**Post date:** [November 18, 2022, 1:40pm UTC](https://discuss.elastic.co/t/logstash-connection-with-oracle-wallet/319300/3 "2022-11-18T13:40:45Z")

</div>

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](https://discuss.elastic.co/t/logstash-cannot-connect-to-oracle-cloud-using-wallet-key/248059) 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.

---

<div class="post-metadata">

**Author:** ![Num](https://avatars.discourse-cdn.com/v4/letter/n/db5fbb/32.png) [@Num](https://discuss.elastic.co/u/Num)\
**Post date:** [November 22, 2022, 2:31pm UTC](https://discuss.elastic.co/t/logstash-connection-with-oracle-wallet/319300/4 "2022-11-22T14:31:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 20, 2022, 2:31pm UTC](https://discuss.elastic.co/t/logstash-connection-with-oracle-wallet/319300/5 "2022-12-20T14:31:39Z")

</div>

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