How to use Fuent Bit with Docker-compose

2,328 views
Skip to first unread message

Alain Picard

unread,
Oct 27, 2021, 5:50:56 AM10/27/21
to Fluent Bit
I first asked this on SO but might not have been the right place.

I want to use the Fluent Bit docker image to help me persist the ephemeral docker container logs to a location on my host (and later use it to ship logs elsewhere).

I am facing issues such as:

    Cannot start service clamav: failed to initialize logging driver: dial tcp 127.0.0.1:24224: connect: connection refused

I have read a number of post including
https://stackoverflow.com/questions/55232151/configuring-fluentbit-with-docker but I'm still at a lost.

My docker-compose is made up of nginx, our app, keycloak, elasticsearch and clamav. I have added fluent-bit, made it first to starts via depends on. I changed the other services to use the fluentd logging driver.

Part of config:

    clamav:
      container_name: clamav-app
      image: tiredofit/clamav:latest
      restart: always
      volumes:
        - ./clamav/data:/data
        - ./clamav/logs:/logs
      environment:
        - ZABBIX_HOSTNAME=clamav-app
        - DEFINITIONS_UPDATE_FREQUENCY=60
      networks:
        - iris-network
      expose:
        - "3310"
      depends_on:
        - fluentbit
      logging:
        driver: fluentd

    fluentbit:
      container_name: iris-fluent
      image: fluent/fluent-bit:latest
      restart: always
      networks:
        - iris-network
      volumes:
        - ./fluent-bit/etc:/fluent-bit/etc
      ports:
        - "24224:24224"
        - "24224:24224/udp"

I have tried to proxy_pass 24224 to fluentbit in nginx and start nginx first, and that avoided the error on clamav and es, but same error with keycloak.

So how can I configure the service to use the host or is it that localhost is not the "external" host?

Thanks
Alain

Eduardo Silva

unread,
Oct 29, 2021, 10:56:37 AM10/29/21
to Alain Picard, Fluent Bit
I am not familiar with all the details in docker compose, maybe forward this question to our slack channel

--
You received this message because you are subscribed to the Google Groups "Fluent Bit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fluent-bit+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fluent-bit/39ae5a3e-eb6b-4626-b9ca-c79fccf21bd5n%40googlegroups.com.


--

Alain Picard

unread,
Oct 29, 2021, 10:58:30 AM10/29/21
to Eduardo Silva, Fluent Bit
Thanks, I will do that.
Reply all
Reply to author
Forward
0 new messages