# Logstash read configuration values from properties file

**URL:** <https://discuss.elastic.co/t/logstash-read-configuration-values-from-properties-file/266894>\
**Category:** Logstash\
**Tags:** elastic-stack-security\
**Created:** [March 11, 2021, 7:19am UTC](https://discuss.elastic.co/t/logstash-read-configuration-values-from-properties-file/266894 "2021-03-11T07:19:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![adityaPsl](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@adityaPsl](https://discuss.elastic.co/u/adityaPsl)\
**Post date:** [March 11, 2021, 7:19am UTC](https://discuss.elastic.co/t/logstash-read-configuration-values-from-properties-file/266894/1 "2021-03-11T07:19:02Z")

</div>

Hello Team,

Could you please help me understand is there an option to keep configuration variables outside of pipeline.  
for example if i have 4 pipeline with elasticsearch as input and output for this most of the configuration would be same and making changes to this would also be very easy . so can i keep few variables in file like hosts , keystore etc in a config file and read it from there.

Thanks for your help and support.

Thank you,  
Aditya

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [March 11, 2021, 4:20pm UTC](https://discuss.elastic.co/t/logstash-read-configuration-values-from-properties-file/266894/2 "2021-03-11T16:20:52Z")

</div>

You can reference [environment variables](https://www.elastic.co/guide/en/logstash/current/environment-variables.html) in the configuration (but [not](https://github.com/elastic/logstash/issues/5115) in conditionals). logstash also supports the use of a [keystore](https://www.elastic.co/guide/en/logstash/current/keystore.html) for passwords and keys, which are hopefully environment specific.

---

<div class="post-metadata">

**Author:** ![adityaPsl](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@adityaPsl](https://discuss.elastic.co/u/adityaPsl)\
**Post date:** [March 11, 2021, 6:12pm UTC](https://discuss.elastic.co/t/logstash-read-configuration-values-from-properties-file/266894/3 "2021-03-11T18:12:30Z")

</div>

Thank you very much Badger, it worked for me. could you please suggest what is the best way to maintain environment variables.

---

<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:** [April 8, 2021, 6:13pm UTC](https://discuss.elastic.co/t/logstash-read-configuration-values-from-properties-file/266894/4 "2021-04-08T18:13:03Z")

</div>

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