# Filebeat can't talk to logstash with connection refused error

**URL:** https://discuss.elastic.co/t/filebeat-cant-talk-to-logstash-with-connection-refused-error/56353
**Category:** Beats
**Tags:** filebeat
**Created:** [July 26, 2016, 5:28am UTC](https://discuss.elastic.co/t/filebeat-cant-talk-to-logstash-with-connection-refused-error/56353 "2016-07-26T05:28:46Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![caoping](https://avatars.discourse-cdn.com/v4/letter/c/aca169/32.png) [@caoping](https://discuss.elastic.co/u/caoping)
#### Post date: [July 26, 2016, 5:28am UTC](https://discuss.elastic.co/t/filebeat-cant-talk-to-logstash-with-connection-refused-error/56353/1 "2016-07-26T05:28:46Z")

</div>

I installed & configured filebeat in host A, logstash in host B. I hope filebeat sending log data to logstash in host B. However, after starting filebeat and logstash, error at filebeat side occurred. Below is the error info:

> **2016-07-26T10:42:46+08:00 INFO Start sending events to output**  
> **2016-07-26T10:42:46+08:00 INFO Connecting error publishing events (retrying): dial tcp 9.112.224.129:5044: getsockopt: connection refused**

No error in logstash side.  
I found some people posted the same problem in _stackoverflow_, but nobody answered it. Anyone here know why it happened and how to solve it? Thanks a lot!

By the way, version of filebeat is 1.2.3. version of logstash is 2.1.1

below is part of filebeat configuration, no TLS enabled:

> logstash:  
> hosts:["9.112.224.129:5044"]

Part of logstash configuration:

> input {  
> beats {  
> hosts =\> "127.0.0.1"  
> port =\> 5044  
> }  
> }

---

<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: [July 26, 2016, 5:48am UTC](https://discuss.elastic.co/t/filebeat-cant-talk-to-logstash-with-connection-refused-error/56353/2 "2016-07-26T05:48:32Z")

</div>

> [@caoping](#):
>
> hosts =\> "127.0.0.1"

Would be why, you aren't listening on `9.112.224.129`.

---

<div class="post-metadata">

### Author: ![caoping](https://avatars.discourse-cdn.com/v4/letter/c/aca169/32.png) [@caoping](https://discuss.elastic.co/u/caoping)
#### Post date: [July 26, 2016, 5:57am UTC](https://discuss.elastic.co/t/filebeat-cant-talk-to-logstash-with-connection-refused-error/56353/3 "2016-07-26T05:57:59Z")

</div>

my understanding is that, it's configuration of logstash, which is in 9.112.224.129. Filebeat sends log data to 9.112.224.129:5044, so logstash should listen to localhost at port 5044. Not correct?

---

<div class="post-metadata">

### Author: ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)
#### Post date: [July 26, 2016, 6:39am UTC](https://discuss.elastic.co/t/filebeat-cant-talk-to-logstash-with-connection-refused-error/56353/4 "2016-07-26T06:39:00Z")

</div>

To get started I would recommend not to specify the host at all. Please follow the getting started guide: [https://www.elastic.co/guide/en/beats/libbeat/1.2/logstash-installation.html#logstash-setup](https://www.elastic.co/guide/en/beats/libbeat/1.2/logstash-installation.html#logstash-setup)

---

<div class="post-metadata">

### Author: ![caoping](https://avatars.discourse-cdn.com/v4/letter/c/aca169/32.png) [@caoping](https://discuss.elastic.co/u/caoping)
#### Post date: [July 26, 2016, 6:46am UTC](https://discuss.elastic.co/t/filebeat-cant-talk-to-logstash-with-connection-refused-error/56353/5 "2016-07-26T06:46:00Z")

</div>

Hi Ruflin

Thank you so much. 😄 It works and filebeat can talk to logstash now after removing the host line. Thank you again.

---

<div class="post-metadata">

### Author: ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)
#### Post date: [July 26, 2016, 3:17pm UTC](https://discuss.elastic.co/t/filebeat-cant-talk-to-logstash-with-connection-refused-error/56353/6 "2016-07-26T15:17:03Z")

</div>


