# Output to unicast ES Cluster, how?

**URL:** https://discuss.elastic.co/t/output-to-unicast-es-cluster-how/38796
**Category:** Logstash
**Created:** [January 10, 2016, 2:29am UTC](https://discuss.elastic.co/t/output-to-unicast-es-cluster-how/38796 "2016-01-10T02:29:36Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jnpetty](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@jnpetty](https://discuss.elastic.co/u/jnpetty)
#### Post date: [January 10, 2016, 2:29am UTC](https://discuss.elastic.co/t/output-to-unicast-es-cluster-how/38796/1 "2016-01-10T02:29:36Z")

</div>

I have a 3 node ES cluster setup and im trying to figure out how to make Logstash output to a cluster. I know that I can add something similar to the following:

```
elasticsearch {
                cluster => "logstash-cluster"
                host => "logstash"
 }

```

But if I understand things correctly this will only work with a multicast configuration. My ES cluster is configured in a unicast configuration. So I would like to not send to only one host incase that host is down for some reason. How do I configure Logstash?

---

<div class="post-metadata">

### Author: ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)
#### Post date: [January 10, 2016, 5:04am UTC](https://discuss.elastic.co/t/output-to-unicast-es-cluster-how/38796/2 "2016-01-10T05:04:54Z")

</div>

It's not unicast or multicast on their own. It's unicast and multicast _discovery._ What this means for ES is that hosts provided for unicast discovery are only helpers. Each node gets the entire cluster state after finding even one member.

That said, you shouldn't be able to even use the `cluster` option with the 2.x releases of Logstash in the `elasticsearch` output block. It defaults to use the http protocol now, which is preferred. The client will route the documents to the cluster for you.

---

<div class="post-metadata">

### Author: ![jnpetty](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@jnpetty](https://discuss.elastic.co/u/jnpetty)
#### Post date: [January 10, 2016, 5:51am UTC](https://discuss.elastic.co/t/output-to-unicast-es-cluster-how/38796/3 "2016-01-10T05:51:20Z")

</div>

Ok so I modified my output as follows:

```
output {
  elasticsearch { hosts => ["192.168.20.20:9200", "192.168.20.21:9200", "192.168.20.22:9200"] }
}

```

Now what happens if Logstash is trying to send logs to 192.168.20.20, but its offline? Will it fail-over to 192.168.20.21?

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [January 10, 2016, 8:59am UTC](https://discuss.elastic.co/t/output-to-unicast-es-cluster-how/38796/4 "2016-01-10T08:59:55Z")

</div>

Yep, and it uses all 3 in load balancing.

---

<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, 5:16am UTC](https://discuss.elastic.co/t/output-to-unicast-es-cluster-how/38796/5 "2017-07-06T05:16:13Z")

</div>


