# Recommended way to maintain multiple logstash output plugin configuration

**URL:** <https://discuss.elastic.co/t/recommended-way-to-maintain-multiple-logstash-output-plugin-configuration/126678>\
**Category:** Logstash\
**Created:** [April 4, 2018, 6:37am UTC](https://discuss.elastic.co/t/recommended-way-to-maintain-multiple-logstash-output-plugin-configuration/126678 "2018-04-04T06:37:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikhil\_Utane](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nikhil_utane/32/27547_2.png) [@Nikhil\_Utane](https://discuss.elastic.co/u/Nikhil_Utane)\
**Post date:** [April 4, 2018, 6:37am UTC](https://discuss.elastic.co/t/recommended-way-to-maintain-multiple-logstash-output-plugin-configuration/126678/1 "2018-04-04T06:37:28Z")

</div>

Hi,

Since this would be a common problem faced by many, would like to understand how you are solving it.

We have multiple Elasticsearch setups and common code in git. This includes the logstash output plugin configuration file. Now the challenge is how to keep the ES\_HOSTS info different for different setups but still have common version in git. I don't want to keep different logstash output config file. Best would have been the use of environment variables but this only supports a single ES\_HOST and not a list.  
So how are you achieving both the objectives, no duplicate code with the flexibility to specify different ES\_HOSTS for different setups?

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:** [April 4, 2018, 7:08am UTC](https://discuss.elastic.co/t/recommended-way-to-maintain-multiple-logstash-output-plugin-configuration/126678/2 "2018-04-04T07:08:18Z")

</div>

If you generate and deploy your configuration files with e.g. Ansible you can easily customize the files for different environments.

---

<div class="post-metadata">

**Author:** ![Nikhil\_Utane](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nikhil_utane/32/27547_2.png) [@Nikhil\_Utane](https://discuss.elastic.co/u/Nikhil_Utane)\
**Post date:** [April 4, 2018, 8:55am UTC](https://discuss.elastic.co/t/recommended-way-to-maintain-multiple-logstash-output-plugin-configuration/126678/3 "2018-04-04T08:55:01Z")

</div>

Thanks Magnus. We started using Ansible to bring up all setups from scratch. Will add this as well.  
Regards.

---

<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:** [May 2, 2018, 8:55am UTC](https://discuss.elastic.co/t/recommended-way-to-maintain-multiple-logstash-output-plugin-configuration/126678/4 "2018-05-02T08:55:20Z")

</div>

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