# Best practices for logstash output configuration and Elasticsearch

**URL:** <https://discuss.elastic.co/t/best-practices-for-logstash-output-configuration-and-elasticsearch/281642>\
**Category:** Logstash\
**Created:** [August 17, 2021, 8:19am UTC](https://discuss.elastic.co/t/best-practices-for-logstash-output-configuration-and-elasticsearch/281642 "2021-08-17T08:19:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vinay\_Kumar2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vinay_kumar2/32/64745_2.png) [@Vinay\_Kumar2](https://discuss.elastic.co/u/Vinay_Kumar2)\
**Post date:** [August 17, 2021, 8:19am UTC](https://discuss.elastic.co/t/best-practices-for-logstash-output-configuration-and-elasticsearch/281642/1 "2021-08-17T08:19:08Z")

</div>

Hello,

My question is related to the correct way to configure the output, for Elasticsearch.

Right now my Elasticsearch cluster is one dedicated master node, 3 data nodes and acts as master eligible nodes and 1 coordinating node.

how to configure output for elasticsearch in logstash, i would like to know best practices for the same  
Any recommendations?

---

<div class="post-metadata">

**Author:** ![AquaX](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aquax/32/92006_2.png) [@AquaX](https://discuss.elastic.co/u/AquaX)\
**Post date:** [August 24, 2021, 6:42pm UTC](https://discuss.elastic.co/t/best-practices-for-logstash-output-configuration-and-elasticsearch/281642/2 "2021-08-24T18:42:31Z")

</div>

The hosts entry for the elasticsearch output can take an array of values, meaning it will automatically load balance between each of the entries you define.

> **[Elasticsearch output plugin | Logstash Reference \[7.14\] | Elastic](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-hosts)**

Point your logstash output to the three data nodes in an array and you should be good to go.

---

<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:** [September 21, 2021, 6:43pm UTC](https://discuss.elastic.co/t/best-practices-for-logstash-output-configuration-and-elasticsearch/281642/3 "2021-09-21T18:43:03Z")

</div>

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