# Logstash elastichsearch output in case of ES cluster

**URL:** https://discuss.elastic.co/t/logstash-elastichsearch-output-in-case-of-es-cluster/34782
**Category:** Logstash
**Created:** [November 17, 2015, 10:15am UTC](https://discuss.elastic.co/t/logstash-elastichsearch-output-in-case-of-es-cluster/34782 "2015-11-17T10:15:09Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![gildor7](https://avatars.discourse-cdn.com/v4/letter/g/cc9497/32.png) [@gildor7](https://discuss.elastic.co/u/gildor7)
#### Post date: [November 17, 2015, 10:15am UTC](https://discuss.elastic.co/t/logstash-elastichsearch-output-in-case-of-es-cluster/34782/1 "2015-11-17T10:15:09Z")

</div>

Hello,

I have the following situation:

- 1 node with Logstash indexer
- 3 nodes with Elastichsearch

How should I set the output logstash?

output {  
elasticsearch {  
host =\> "?"  
cluster =\> "ES-cluster"  
}  
}

Have I to set the master hostname only or all nodes?

In the case of a single node declaration, how I can assure the HA when that node is down?

Regards.

---

<div class="post-metadata">

### Author: ![gildor7](https://avatars.discourse-cdn.com/v4/letter/g/cc9497/32.png) [@gildor7](https://discuss.elastic.co/u/gildor7)
#### Post date: [November 17, 2015, 1:09pm UTC](https://discuss.elastic.co/t/logstash-elastichsearch-output-in-case-of-es-cluster/34782/2 "2015-11-17T13:09:33Z")

</div>

Please, help me! 😉

---

<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: [November 17, 2015, 6:47pm UTC](https://discuss.elastic.co/t/logstash-elastichsearch-output-in-case-of-es-cluster/34782/3 "2015-11-17T18:47:33Z")

</div>

Is this Logstash 1.5? Then `protocol` defaults to "node". You'll probably want to use "http" instead. Assuming that from now on.

Set `host` to an array of hostnames. Logstash will pick a random host and move on to the next one if it's unresponsive. If you have dedicated master nodes you probably shouldn't include them in the list but otherwise list all cluster nodes. See the [documentation](https://www.elastic.co/guide/en/logstash/1.5/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-host) for details.

---

<div class="post-metadata">

### Author: ![gildor7](https://avatars.discourse-cdn.com/v4/letter/g/cc9497/32.png) [@gildor7](https://discuss.elastic.co/u/gildor7)
#### Post date: [November 18, 2015, 11:33am UTC](https://discuss.elastic.co/t/logstash-elastichsearch-output-in-case-of-es-cluster/34782/4 "2015-11-18T11:33:30Z")

</div>

Thanks for the reply. Yes, it's 1.5.

I setup the logstash output in this way:

output {  
elasticsearch {  
host =\> ["1.1.1.1","1.1.1.2","1.1.1.3"]  
protocol =\> "http"  
cluster =\> "ES-cluster"  
}  
}

The test returned this output:

Error: The setting `host` in plugin `elasticsearch` is obsolete and is no longer available. Please use the 'hosts' setting instead. You can specify multiple entries separated by comma in 'host:port' format. If you have any questions about this, you are invited to visit [https://discuss.elastic.co/c/logstash](https://discuss.elastic.co/c/logstash) and ask.

So I changed in this way:

output {  
elasticsearch {  
hosts =\> ['1.1.1.1:9200','1.1.1.2:9200','1.1.1.3:9200']  
protocol =\> "http"  
cluster =\> "ES-cluster"  
}  
}

And this is the new error:

Unknown setting 'protocol' for elasticsearch {:level=\>:error}  
Unknown setting 'cluster' for elasticsearch {:level=\>:error}  
Error: Something is wrong with your configuration.

---

<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: [November 19, 2015, 6:53am UTC](https://discuss.elastic.co/t/logstash-elastichsearch-output-in-case-of-es-cluster/34782/5 "2015-11-19T06:53:23Z")

</div>

As the error message indicates the `protocol` and `cluster` options no longer exist. The version of the plugin that ships with Logstash 2.0 is HTTP-only so those options aren't needed.

---

<div class="post-metadata">

### Author: ![gayathri](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@gayathri](https://discuss.elastic.co/u/gayathri)
#### Post date: [July 12, 2016, 9:01am UTC](https://discuss.elastic.co/t/logstash-elastichsearch-output-in-case-of-es-cluster/34782/6 "2016-07-12T09:01:09Z")

</div>

Then how we will set the cluster name in this case?

---

<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 12, 2016, 9:33am UTC](https://discuss.elastic.co/t/logstash-elastichsearch-output-in-case-of-es-cluster/34782/7 "2016-07-12T09:33:52Z")

</div>

When using HTTP the cluster name is irrelevant.

---

<div class="post-metadata">

### Author: ![gayathri](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@gayathri](https://discuss.elastic.co/u/gayathri)
#### Post date: [July 12, 2016, 9:35am UTC](https://discuss.elastic.co/t/logstash-elastichsearch-output-in-case-of-es-cluster/34782/8 "2016-07-12T09:35:03Z")

</div>

Ok, Thanks magnus

---

<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: [July 6, 2017, 4:48am UTC](https://discuss.elastic.co/t/logstash-elastichsearch-output-in-case-of-es-cluster/34782/9 "2017-07-06T04:48:28Z")

</div>


