# How can we make output to elasticsearch host array to load from a file

**URL:** <https://discuss.elastic.co/t/how-can-we-make-output-to-elasticsearch-host-array-to-load-from-a-file/72861>\
**Category:** Logstash\
**Created:** [January 26, 2017, 8:07am UTC](https://discuss.elastic.co/t/how-can-we-make-output-to-elasticsearch-host-array-to-load-from-a-file/72861 "2017-01-26T08:07:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![macymin](https://avatars.discourse-cdn.com/v4/letter/m/8e7dd6/32.png) [@macymin](https://discuss.elastic.co/u/macymin)\
**Post date:** [January 26, 2017, 8:07am UTC](https://discuss.elastic.co/t/how-can-we-make-output-to-elasticsearch-host-array-to-load-from-a-file/72861/1 "2017-01-26T08:07:51Z")

</div>

Hi, when logstash output to elasticsearch , in our case the hosts can be changed quite frequently. is there any way we can configure the hosts to load from certain files instead of change the server inside logstash conf itself? we are versionized logstash conf so dont want to create a new version just because the server list change.

---

<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:** [January 26, 2017, 8:19am UTC](https://discuss.elastic.co/t/how-can-we-make-output-to-elasticsearch-host-array-to-load-from-a-file/72861/2 "2017-01-26T08:19:15Z")

</div>

This isn't possible out of the box. Since you're going to have to reload the Logstash configuration anyway, perhaps you could generate the configuration file based on a template before you reload the config?

---

<div class="post-metadata">

**Author:** ![macymin](https://avatars.discourse-cdn.com/v4/letter/m/8e7dd6/32.png) [@macymin](https://discuss.elastic.co/u/macymin)\
**Post date:** [January 26, 2017, 8:26am UTC](https://discuss.elastic.co/t/how-can-we-make-output-to-elasticsearch-host-array-to-load-from-a-file/72861/3 "2017-01-26T08:26:25Z")

</div>

Thanks mag for quick reply. but filer plugin part is impossible to generate from scratch, means i have to merge the org logstash conf (with filter plugin and everything inside) and make the new output host config to replace the hosts value in org conf.....is my understanding correct?

---

<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:** [January 26, 2017, 10:51am UTC](https://discuss.elastic.co/t/how-can-we-make-output-to-elasticsearch-host-array-to-load-from-a-file/72861/4 "2017-01-26T10:51:20Z")

</div>

You can put the elasticsearch output configuration in a file of its own, but yeah I think you get the idea.

---

<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:** [February 23, 2017, 10:51am UTC](https://discuss.elastic.co/t/how-can-we-make-output-to-elasticsearch-host-array-to-load-from-a-file/72861/5 "2017-02-23T10:51:41Z")

</div>

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