title: Docker-compose filebeat connection issue to logstash
body: <p>I am running logstash and filebeat inside separate docker-compose.yml. But filebeat cannot connect to logstash. I can properly telnet into logstash <code>telnet 127.0.0.1 5044</code> after I wait for the logstash pipelines to start.</p>
  
  <p>Filebeat cannot create a connection. I get this error.
  <code>ERROR  pipeline/output.go:74   Failed to connect: dial tcp 127.0.0.1:5044: getsockopt: connection refused</code></p>
  
  <p>This is my docker-compose for filebeat.</p>
  
  <pre><code>version: '2'
  
  services:
    filebeat:
      image: docker.elastic.co/beats/filebeat:6.2.3
      container_name: filebeat
      user: root
      volumes:
        - flask-sync:/home/flask/app/web:ro
        - ./filebeat/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro
  
  volumes:
    flask-sync:
      external: true
  </code></pre>
  
  <p>This is my filebeat.yml</p>
  
  <pre><code>filebeat.prospectors:
  - type: log
    enabled: true
    paths:
      - /home/flask/app/web/tmp/log
  
  output.logstash:
    hosts: ["127.0.0.1:5044"]
  </code></pre>
  
  <p>This is my docker-compose for logstash</p>
  
  <pre><code>version: '2'
  
  services:
    logstash:
      image: docker.elastic.co/logstash/logstash:6.2.4
      container_name: logstash
      ports:
        - "5044:5044"
      volumes:
        - ./logstash/logstash.conf:/usr/share/logstash/logstash.conf:ro
        - ./logstash/config/:/usr/share/logstash/config/:ro
      command: bin/logstash -f logstash.conf --config.reload.automatic
  </code></pre>
  
  <p>This is my logstash.conf</p>
  
  <pre><code>input { 
    beats {
      port =&gt; 5044
    }
  }
  
  filter {
  }
  
  
  output {
    stdout { codec =&gt; rubydebug }
  }
  </code></pre>