# Dial tcp (ip number):5044: getsockopt: connection refused

**URL:** https://discuss.elastic.co/t/dial-tcp-ip-number-5044-getsockopt-connection-refused/77104
**Category:** Beats
**Created:** [March 2, 2017, 7:59am UTC](https://discuss.elastic.co/t/dial-tcp-ip-number-5044-getsockopt-connection-refused/77104 "2017-03-02T07:59:51Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![tomer](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@tomer](https://discuss.elastic.co/u/tomer)
#### Post date: [March 2, 2017, 7:59am UTC](https://discuss.elastic.co/t/dial-tcp-ip-number-5044-getsockopt-connection-refused/77104/1 "2017-03-02T07:59:51Z")

</div>

Hi,

I am trying to transfer logs from filebeats to logstash, but I get this error in the filebeats log:

```
dial tcp (ip number):5044: getsockopt: connection refused

```

In my LogStash config.d the configuration file is: and the content is:

```
  input {
  beats {
    port => 5044
  }
}
output {
  elasticsearch {
    hosts => "(ipnumber):9200"
    manage_template => false
    index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
    document_type => "%{[@metadata][type]}"
  }
}

```

My filebeat configuration is:

```
#----------------------------- Logstash output --------------------------------
output.logstash:
  # The Logstash hosts
  hosts: ["(ipnumber):5044"]
  index: filebeat
  # Optional SSL. By default is off.
  # List of root certificates for HTTPS server verifications
  #ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]

  # Certificate for SSL client authentication
  #ssl.certificate: "/etc/pki/client/cert.pem"

  # Client Certificate Key
  #ssl.key: "/etc/pki/client/cert.key"

```

As mentioned in [here](https://discuss.elastic.co/t/configure-filebeat-for-all-logs/39514/4) I checked and there is no more configuration files in conf.d  
As mentioned in [here](https://discuss.elastic.co/t/filebeat-cant-talk-to-logstash-with-connection-refused-error/56353/2) I did not specify the ip number

Many thanks!

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [March 2, 2017, 9:17am UTC](https://discuss.elastic.co/t/dial-tcp-ip-number-5044-getsockopt-connection-refused/77104/2 "2017-03-02T09:17:28Z")

</div>

Are you able to telnet to port 5044 on the Logstash machine from the one where Filebeat is running?

---

<div class="post-metadata">

### Author: ![tomer](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@tomer](https://discuss.elastic.co/u/tomer)
#### Post date: [March 2, 2017, 9:18am UTC](https://discuss.elastic.co/t/dial-tcp-ip-number-5044-getsockopt-connection-refused/77104/3 "2017-03-02T09:18:07Z")

</div>

Hey Christian, They are actually sitting on the same VM

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [March 2, 2017, 9:23am UTC](https://discuss.elastic.co/t/dial-tcp-ip-number-5044-getsockopt-connection-refused/77104/4 "2017-03-02T09:23:14Z")

</div>

Does it work if you change the IP to localhost?

---

<div class="post-metadata">

### Author: ![tomer](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@tomer](https://discuss.elastic.co/u/tomer)
#### Post date: [March 2, 2017, 9:27am UTC](https://discuss.elastic.co/t/dial-tcp-ip-number-5044-getsockopt-connection-refused/77104/5 "2017-03-02T09:27:37Z")

</div>

No the error is constant also then. I get still:

```
dial tcp 127.0.0.1:5044: getsockopt: connection refused
```

---

<div class="post-metadata">

### Author: ![tomer](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@tomer](https://discuss.elastic.co/u/tomer)
#### Post date: [March 2, 2017, 9:30am UTC](https://discuss.elastic.co/t/dial-tcp-ip-number-5044-getsockopt-connection-refused/77104/6 "2017-03-02T09:30:37Z")

</div>

When I connect the filebeat straight to the ES there is a connection

---

<div class="post-metadata">

### Author: ![tomer](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@tomer](https://discuss.elastic.co/u/tomer)
#### Post date: [March 2, 2017, 12:42pm UTC](https://discuss.elastic.co/t/dial-tcp-ip-number-5044-getsockopt-connection-refused/77104/7 "2017-03-02T12:42:28Z")

</div>

Is this possible because I dont have the beats plugin? If so I am using 5.2, and as far as I know version 5.2 does not use plugins, and how can i install this?

---

<div class="post-metadata">

### Author: ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)
#### Post date: [March 2, 2017, 1:06pm UTC](https://discuss.elastic.co/t/dial-tcp-ip-number-5044-getsockopt-connection-refused/77104/8 "2017-03-02T13:06:25Z")

</div>

Is logstash running? Have you tried `telnet localhost 5044`?

---

<div class="post-metadata">

### Author: ![tomer](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@tomer](https://discuss.elastic.co/u/tomer)
#### Post date: [March 2, 2017, 3:12pm UTC](https://discuss.elastic.co/t/dial-tcp-ip-number-5044-getsockopt-connection-refused/77104/9 "2017-03-02T15:12:25Z")

</div>

Hi steffends,

Well I tried to do telnet and it did not turn out good 🙂 .  
When I try ping it does work, how can this be?

---

<div class="post-metadata">

### Author: ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)
#### Post date: [March 2, 2017, 5:13pm UTC](https://discuss.elastic.co/t/dial-tcp-ip-number-5044-getsockopt-connection-refused/77104/10 "2017-03-02T17:13:49Z")

</div>

is logstash running?

---

<div class="post-metadata">

### Author: ![tomer](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@tomer](https://discuss.elastic.co/u/tomer)
#### Post date: [March 5, 2017, 8:32am UTC](https://discuss.elastic.co/t/dial-tcp-ip-number-5044-getsockopt-connection-refused/77104/11 "2017-03-05T08:32:54Z")

</div>

Hi @steffens,

Thank you for all the help, I succeeded by installing Logstash on a diff. VM.

From some reason when they were running on the same machine they did not work (yes also Logstash was running)

---

<div class="post-metadata">

### Author: ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)
#### Post date: [March 11, 2017, 6:03pm UTC](https://discuss.elastic.co/t/dial-tcp-ip-number-5044-getsockopt-connection-refused/77104/12 "2017-03-11T18:03:53Z")

</div>

Which OS have you been using?

---

<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 23, 2017, 7:59am UTC](https://discuss.elastic.co/t/dial-tcp-ip-number-5044-getsockopt-connection-refused/77104/13 "2017-03-23T07:59:58Z")

</div>

This topic was automatically closed after 21 days. New replies are no longer allowed.
