# \[BUG\] Bug in logs related to Kafka connection

**URL:** <https://discuss.elastic.co/t/bug-bug-in-logs-related-to-kafka-connection/269625>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [April 8, 2021, 4:33pm UTC](https://discuss.elastic.co/t/bug-bug-in-logs-related-to-kafka-connection/269625 "2021-04-08T16:33:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dacamposol](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dacamposol/32/80191_2.png) [@dacamposol](https://discuss.elastic.co/u/dacamposol)\
**Post date:** [April 8, 2021, 4:33pm UTC](https://discuss.elastic.co/t/bug-bug-in-logs-related-to-kafka-connection/269625/1 "2021-04-08T16:33:29Z")

</div>

Good afternoon everyone,

I think that I have found a bug in the logs of Filebeat, version 7.12.0.

I have a Kafka machine in a datacenter, let's call it Datacenter A, and I setup the Filebeat in another datacenter, in this case the Datacenter B.

I configured my Filebeat with Kafka as output, and I was wondering why I didn't receive any event in my Kafka topic, when Filebeat said that everything was okay and that it was sending events.

Well, the problem is that I didn't have opened the port 6397 for the Kafka host, so basically when I did a telnet call I discovered that it was impossible to connect. But when I go to my Filebeat logs, it says the following:

```auto
2021-04-08T18:27:07.627+0200 INFO [publisher_pipeline_output] pipeline/output.go:143 Connecting to kafka(5X.XX.XX.XX:6397)
2021-04-08T18:27:07.627+0200 INFO [publisher_pipeline_output] pipeline/output.go:151 Connection to kafka(5X.XX.XX.XX:6397) established

```

So I suppose there is some sort of error in the logging, since it's **literally impossible** that Filebeat has established connection with Kafka in that host and port.

Of course, after opening the port in the firewall, it started working properly and sending the events.

---

<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:** [May 6, 2021, 6:34pm UTC](https://discuss.elastic.co/t/bug-bug-in-logs-related-to-kafka-connection/269625/2 "2021-05-06T18:34:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![TiagoQueiroz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tiagoqueiroz/32/107061_2.png) [@TiagoQueiroz](https://discuss.elastic.co/u/TiagoQueiroz)\
**Post date:** [January 13, 2023, 3:10pm UTC](https://discuss.elastic.co/t/bug-bug-in-logs-related-to-kafka-connection/269625/3 "2023-01-13T15:10:02Z")

</div>

Hi @dacamposol,

This log message is misleading, it does not mean that the actual connection was created, it just means that the worker has been correctly setup and is read to send data. The real connection to the Kafka server will only be established when the first event is sent.

With Filebeat you can use the `./filebeat test output` command to test the connection to an output, this will create a connection and return whether it was successful or not.

There is some more information on the GH issue: [Beats misreport established Kafka connection · Issue #34177 · elastic/beats · GitHub](https://github.com/elastic/beats/issues/34177)
