# Jdbc\_password\_filepath not functioning in input-jdbc filter

**URL:** https://discuss.elastic.co/t/jdbc-password-filepath-not-functioning-in-input-jdbc-filter/92089
**Category:** Logstash
**Created:** [July 6, 2017, 11:35am UTC](https://discuss.elastic.co/t/jdbc-password-filepath-not-functioning-in-input-jdbc-filter/92089 "2017-07-06T11:35:41Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![lnm](https://avatars.discourse-cdn.com/v4/letter/l/c5a1d2/32.png) [@lnm](https://discuss.elastic.co/u/lnm)
#### Post date: [July 6, 2017, 11:35am UTC](https://discuss.elastic.co/t/jdbc-password-filepath-not-functioning-in-input-jdbc-filter/92089/1 "2017-07-06T11:35:41Z")

</div>

Hi everyone,

I'm currently building some Logstash input filters which works great. The one thing I can't get working though is the jdbc\_password\_filepath setting.

The query below is what I'm trying to run, with some stuff like SID, username/password anonymized. When I comment the jdbc\_password\_filepath and uncomment jdbc\_password everything works fine so there's nothing wrong with the code. The credential file has the logstash user as owner and has read write permissions for the user (600). The file is 1 line large and only contains the plain text password, copy/pasted from the config file.

`input { jdbc { jdbc_validate_connection => true jdbc_connection_string => "jdbc:oracle:thin:@SID" jdbc_user => "jdbcuser" #jdbc_password => "jdbcpassword" jdbc_password_filepath => "/etc/logstash/credential_file" jdbc_driver_library => "/opt/logstash/config/lib/ojdbc7.jar" jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver" statement => "SELECT query FROM table" schedule => "*/5 * * * *" tags => [jdbc] } }`

The error message Logstash shows me is:

`:error=>"Java::JavaSql::SQLException: ORA-01017: invalid username/password; logon denied\n"}`

Since the credentials work from inside the input config it appears the issue is with the jdbc\_password\_filepath parameter. Or the password file is not formatted correctly, but the documentation doesn't mention anything about formatting.

Any ideas would be welcome!

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [July 9, 2017, 6:34pm UTC](https://discuss.elastic.co/t/jdbc-password-filepath-not-functioning-in-input-jdbc-filter/92089/2 "2017-07-09T18:34:48Z")

</div>

Have you tried using e.g. Wireshark to inspect the network traffic and see what password is actually sent? Does it match what's being sent when you're not using a password file? (I'm assuming it's an unencrypted TCP connection.)

---

<div class="post-metadata">

### Author: ![lnm](https://avatars.discourse-cdn.com/v4/letter/l/c5a1d2/32.png) [@lnm](https://discuss.elastic.co/u/lnm)
#### Post date: [July 13, 2017, 1:11pm UTC](https://discuss.elastic.co/t/jdbc-password-filepath-not-functioning-in-input-jdbc-filter/92089/3 "2017-07-13T13:11:33Z")

</div>

Apparently it's a bug. There's already a pr for it: [https://github.com/logstash-plugins/logstash-input-jdbc/pull/217](https://github.com/logstash-plugins/logstash-input-jdbc/pull/217)

Wireshark would've indeed be a good next step to look at, thanks for the suggestion.

---

<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: [August 10, 2017, 1:11pm UTC](https://discuss.elastic.co/t/jdbc-password-filepath-not-functioning-in-input-jdbc-filter/92089/4 "2017-08-10T13:11:40Z")

</div>

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