# Logstash config JDBC Password

**URL:** <https://discuss.elastic.co/t/logstash-config-jdbc-password/139255>\
**Category:** Logstash\
**Created:** [July 10, 2018, 2:29am UTC](https://discuss.elastic.co/t/logstash-config-jdbc-password/139255 "2018-07-10T02:29:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Preethi](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@Preethi](https://discuss.elastic.co/u/Preethi)\
**Post date:** [July 10, 2018, 2:29am UTC](https://discuss.elastic.co/t/logstash-config-jdbc-password/139255/1 "2018-07-10T02:29:52Z")

</div>

Hi,

Would like to know whether can use environmental variables to get the username and password for JDBC plugin in log stash config file?

Or what is the safest way to pass the password to JDBC connection?

Thanks

---

<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 10, 2018, 7:48am UTC](https://discuss.elastic.co/t/logstash-config-jdbc-password/139255/2 "2018-07-10T07:48:07Z")

</div>

[https://www.elastic.co/guide/en/logstash/current/environment-variables.html](https://www.elastic.co/guide/en/logstash/current/environment-variables.html)

---

<div class="post-metadata">

**Author:** ![Preethi](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@Preethi](https://discuss.elastic.co/u/Preethi)\
**Post date:** [July 10, 2018, 1:09pm UTC](https://discuss.elastic.co/t/logstash-config-jdbc-password/139255/3 "2018-07-10T13:09:18Z")

</div>

Hi,

Are there any other approach to protect the JDBC username and password apart from reading environment variables?

---

<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 10, 2018, 1:17pm UTC](https://discuss.elastic.co/t/logstash-config-jdbc-password/139255/4 "2018-07-10T13:17:54Z")

</div>

None that I'm aware of.

---

<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 7, 2018, 1:19pm UTC](https://discuss.elastic.co/t/logstash-config-jdbc-password/139255/5 "2018-08-07T13:19:05Z")

</div>

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