# Error: getsockopt: connection refused

**URL:** https://discuss.elastic.co/t/error-getsockopt-connection-refused/309564
**Category:** Logstash
**Created:** [July 13, 2022, 5:26pm UTC](https://discuss.elastic.co/t/error-getsockopt-connection-refused/309564 "2022-07-13T17:26:58Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![benjamin\_brightson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benjamin_brightson/32/97129_2.png) [@benjamin\_brightson](https://discuss.elastic.co/u/benjamin_brightson)
#### Post date: [July 13, 2022, 5:26pm UTC](https://discuss.elastic.co/t/error-getsockopt-connection-refused/309564/1 "2022-07-13T17:26:58Z")

</div>

Hi Team,

This is to inform you that am trying to setup the multiple beat config with logstash , so initially i started with the single beat config where am facing the " [Error: getsockopt: connection refused]" this error.

```auto
filebeat.yml
filebeat.yml: |-
    filebeat.inputs:
    - type: log

      # Change to true to enable this input configuration.
      enabled: true

      # Paths that should be crawled and fetched. Glob based paths.
      paths:
      - /var/log/*.log

    output.logstash:
      hosts: ['logstash-service.elk-test1.svc.cluster.local:5044']
---

```

logstash.config:

```auto
logstash.conf: |
    # all input will come from filebeat, no local logs
    input {
      beats {
        port => 5044
      }
    }
    filter {
      if [message] =~ /^\{.*\}$/ {
        json {
          source => "message"
        }
      }
      if [ClientHost] {
        geoip {
          source => "ClientHost"
        }
      }
    }
    output {
        elasticsearch {
            hosts => ["https://xxxxxxxxx:9200"]
            username => ["elastic"]
            password => ["xxxxxxxxxxxxxxxxxxxx"]
        }
    }
---

```

```auto
filebeat connectivity error:
2022-07-13T16:46:54.237Z ERROR pipeline/output.go:74 Failed to connect: dial tcp 10.12.1.18:5044: getsockopt: connection refused
2022-07-13T16:46:56.251Z ERROR pipeline/output.go:74 Failed to connect: dial tcp 10.12.1.18:5044: getsockopt: connection refused
2022-07-13T16:47:00.273Z ERROR pipeline/output.go:74 Failed to connect: dial tcp 10.12.1.18:5044: getsockopt: connection refused
2022-07-13T16:47:08.304Z ERROR pipeline/output.go:74 Failed to connect: dial tcp 10.12.1.18:5044: getsockopt: connection refused
2022-0

```

NOTE @benjamin_brightson I (Stephen) properly formatted your text by selecting / highlighting the text then pressing the `</>` button, please do this in the future

![Screen Shot 2022-07-13 at 10.41.30 AM](https://us1.discourse-cdn.com/elastic/original/3X/3/6/36cef8dbcc779538f3f55f98b441e69faa918bf3.png)

---

<div class="post-metadata">

### Author: ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)
#### Post date: [July 15, 2022, 9:04am UTC](https://discuss.elastic.co/t/error-getsockopt-connection-refused/309564/2 "2022-07-15T09:04:29Z")

</div>

Check what is happening on LS side, is LS process started on the tcp 5044 port, is telnet possible from FB to LS on port 5044, try logstash-service.elk-test1.svc.cluster.local:5044 to replace with IP.

---

<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: [August 12, 2022, 9:04am UTC](https://discuss.elastic.co/t/error-getsockopt-connection-refused/309564/3 "2022-08-12T09:04:38Z")

</div>

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