title: Fluent-bit unable to ship logs to fluentd in docker due to EADDRNOTAVAIL
body: <p>I'm trying to setup the EFK stack with fluent-bit on docker containers. While I could push the logs from fluent-bit to elasticsearch, when I tried to integrate fluentd, I'm facing issues with it. This's the exact error msg:</p>
  
  <blockquote>
    <p>unexpected error error_class=Errno::EADDRNOTAVAIL error="Address not available - bind(2) for \"fluent-bit\" port 24224"</p>
  </blockquote>
  
  <p>The services in my <strong>docker-compose</strong> file</p>
  
  <pre>
    elasticsearch:
      image: docker.elastic.co/elasticsearch/elasticsearch:${TAG}
      ports:
        - '9200:9200'
        - '9300:9300'
      volumes:
        - type: bind
          source: ./config/elasticsearch.yml
          target: /usr/share/elasticsearch/config/elasticsearch.yml
          read_only: true
        - type: volume
          source: elasticsearch
          target: /usr/share/elasticsearch/data
      networks:
        - efk_1
    fluentd:
      image: fluent/fluentd:${FLBV}
      ports:
        - '24224:24224'
      volumes:
        - type: bind
          source: ./config/fluent.conf
          target: /fluentd/etc/fluent.conf
          read_only: true
      networks:
        - efk_1
      depends_on:
        - elasticsearch
    fluent-bit:
      image: fluent/fluent-bit:${FBITV}
      ports:
        - '2020:2020'
      volumes:
        - type: bind
          source: ./config/fluent-bit.conf
          target: /fluent-bit/etc/fluent-bit.conf
          read_only: true
        - type: bind
          source: ./sample_logs
          target: /var/log
      networks:
        - efk_1
      depends_on:
        - fluentd
  </pre>
  
  <p>Previously I directly pushed the logs from fluent-bit to elasticsearch like this without fluentd config anywhere:</p>
  
  <pre><code>[SERVICE]
      Flush   2
      Log_Level   debug
  
  [INPUT]
      Name    tail
      Path    /var/log/log.txt
  
  [OUTPUT]
      Name    es
      Match   *
      Host    elasticsearch
      Port    9200
  </code></pre>
  
  <p>This pushed the logs to elasticsearch successfully, but now I added fluentd in between, so fluent-bit will send the logs to fluentd, which will then push to elasticsearch.</p>
  
  <p>fluent-bit conf:</p>
  
  <pre><code>[SERVICE]
      Flush   2
      Log_Level   debug
  
  [INPUT]
      Name    tail
      Path    /var/log/log.txt
  
  [OUTPUT]
      Name    forward
      Match   *
      Host    fluentd
  </code></pre>
  
  <p>fluentd conf:</p>
  
  <pre><code>&lt;source&gt;
      @type forward
      bind fluent-bit
  &lt;/source&gt;
  
  &lt;match **&gt;
      @type stdout
  &lt;/match&gt;
  </code></pre>
  
  <p>This's giving me errors as they're not able to detect the address even though they're part of the same docker network.</p>
  
  <p>These're the errors I'm getting:</p>
  
  <blockquote>
    <p>fluent-bit_1     | [2019/11/06 10:31:02] [error] [io] TCP connection failed: fluentd:24224 (Connection refused)</p>
  </blockquote>
  
  <p>and</p>
  
  <blockquote>
    <p>fluentd_1        | 2019-11-06 10:31:02 +0000 [error]: #0 unexpected error error_class=Errno::EADDRNOTAVAIL error="Address not available - bind(2) for \"fluent-bit\" port 24224"</p>
  </blockquote>
  
  <p>Can someone please help me know where I'm making a mistake?</p>