# Filebeat docker container is not connecting to logstash docker container

**URL:** <https://discuss.elastic.co/t/filebeat-docker-container-is-not-connecting-to-logstash-docker-container/195192>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [August 14, 2019, 11:35am UTC](https://discuss.elastic.co/t/filebeat-docker-container-is-not-connecting-to-logstash-docker-container/195192 "2019-08-14T11:35:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![douy](https://avatars.discourse-cdn.com/v4/letter/d/76d3ee/32.png) [@douy](https://discuss.elastic.co/u/douy)\
**Post date:** [August 14, 2019, 11:35am UTC](https://discuss.elastic.co/t/filebeat-docker-container-is-not-connecting-to-logstash-docker-container/195192/1 "2019-08-14T11:35:01Z")

</div>

Hi,

I've created custom docker images based on ubuntu for elasticsearch, kibana, logstash and filebeat and I'm trying to connect them to each other. I've started out with elasticsearch, which runs perfectly well and is accessable via browser on localhost and gives me the following output:

```
{
  "name" : "smoketestnode",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "ehojjWChScK44ApYnsTYPQ",
  "version" : {
    "number" : "7.3.0",
    "build_flavor" : "oss",
    "build_type" : "deb",
    "build_hash" : "de777fa",
    "build_date" : "2019-07-24T18:30:11.767338Z",
    "build_snapshot" : false,
    "lucene_version" : "8.1.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

```

**elasticsearch.yml:**

```
network.host: 0.0.0.0
node.name: smoketestnode
cluster.initial_master_nodes: smoketestnode

```

The Kibana container also runs perfectly with the following configuration of **kibana.yml:**

```
server.name: kibana
server.host: "0"
elasticsearch.hosts: ["http://elasticsearch:9200"]

```

Via localhost:5601 the kibana UI is accessible and shows me indices of elasticsearch.

The logstash container seems to be running correctly as well with the following configuration:

**pipelines.yml:**

```
- pipeline.id: my-pipeline_1
  path.config: "/usr/share/logstash/config/logstash.conf"
  pipeline.workers: 3

```

**logstash.conf:**

```
input {
    beats {
		host => "0.0.0.0"
        port => 5044
    }
	stdin { }
}

output {
	stdout {
		codec => rubydebug
    }
}

```

and **logstash.yml:**

```
http.host: "0.0.0.0"
node.name: ls-node

```

calling localhost:9600 gives me the folowing information:

```
{"host":"01e71a615d31","version":"7.3.0","http_address":"0.0.0.0:9600","id":"6b3ebcda-7dce-4119-b1e0-9620d2872faf","name":"ls-node","ephemeral_id":"f581e5a4-24a5-4646-b031-3356f421942d","status":"green","snapshot":false,"pipeline":{"workers":2,"batch_size":125,"batch_delay":50},"build_date":"2019-07-24T19:58:34+00:00","build_sha":"e1b53df454f5d8047f5304977ff8984f5b51154d","build_snapshot":false}

```

Now starting the filebeat container with **filebeat.yml:**

```
filebeat.inputs:
- type: log
  paths:
    - /var/log/logstash-tutorial.log 
output.logstash:
  hosts: ["localhost:5044", "localhost:9600"]

```

... creates the following error:

`ERROR pipeline/output.go:100 Failed to connect to failover(backoff(async(tcp://localhost:5044)),backoff(async(tcp://localhost:9600))): dial tcp [::1]:9600: connect: cannot assign requested address`

Am i missing something ? I'm not sure how to solve this. Any help would be appreciated.

---

<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:** [August 15, 2019, 10:31am UTC](https://discuss.elastic.co/t/filebeat-docker-container-is-not-connecting-to-logstash-docker-container/195192/2 "2019-08-15T10:31:41Z")

</div>

In filebeat you have to configure the port that has been configured in the Logstash beats input. Port 9600 is not meant for events being send to. Only port 5044.

---

<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:** [September 12, 2019, 10:31am UTC](https://discuss.elastic.co/t/filebeat-docker-container-is-not-connecting-to-logstash-docker-container/195192/3 "2019-09-12T10:31:44Z")

</div>

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