# Filebeat logstash loadbalance to kafka

**URL:** https://discuss.elastic.co/t/filebeat-logstash-loadbalance-to-kafka/265695
**Category:** Logstash
**Created:** [February 27, 2021, 4:00pm UTC](https://discuss.elastic.co/t/filebeat-logstash-loadbalance-to-kafka/265695 "2021-02-27T16:00:55Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![cool](https://avatars.discourse-cdn.com/v4/letter/c/c6cbf5/32.png) [@cool](https://discuss.elastic.co/u/cool)
#### Post date: [February 27, 2021, 4:00pm UTC](https://discuss.elastic.co/t/filebeat-logstash-loadbalance-to-kafka/265695/1 "2021-02-27T16:00:55Z")

</div>

How to send logs from filebeat/logstash to kafak to multiple datacenters if one datacenter is down logs to be sent to another datacenter.

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [February 27, 2021, 4:14pm UTC](https://discuss.elastic.co/t/filebeat-logstash-loadbalance-to-kafka/265695/2 "2021-02-27T16:14:22Z")

</div>

I don't think this is possible using Filebeat or Logstash alone, you would need a load balancer like HAProxy before sending to Kafka.

Logstash can send data to multiple outputs, but not in a way that it would check if the output is up or down and switch to another one if it is down.

While you can try to implement something like that using some logstash filters, it would be very tricky and I think that the best choice is to use a load balancer like HAProxy.

---

<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: [March 27, 2021, 4:15pm UTC](https://discuss.elastic.co/t/filebeat-logstash-loadbalance-to-kafka/265695/3 "2021-03-27T16:15:18Z")

</div>

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