Filebeat docker container is not connecting to logstash docker container


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: smoketestnode
cluster.initial_master_nodes: smoketestnode

The Kibana container also runs perfectly with the following configuration of kibana.yml: kibana "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:


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


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

output {
	stdout {
		codec => rubydebug

and logstash.yml: "" ls-node

calling localhost:9600 gives me the folowing information:


Now starting the filebeat container with filebeat.yml:

- type: log
    - /var/log/logstash-tutorial.log 
  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.

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.

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