I am trying to configure the docker-compose
file to utilize fluent-bit. In my docker-compose
file I have the following config for fluentbit
fluentbit:
image: fluent/fluent-bit:1.0.4
command: /fluent-bit/bin/fluent-bit -c /fluent-bit/etc/fluent-bit.conf
volumes:
- ./docker_to_es.conf:/fluent-bit/etc/fluent-bit.conf
networks:
- monitor
I run this using docker-compose up
and everything looks fine. To test I do the following:
docker run --network=monitor --log-driver=fluentd --log-opt fluentd-address=192.168.XX.XX:24224 -t ubuntu echo "test logging"
The test is successful but I had to lookup the fluentd-address for the container. In the docker-compose
file I won't be able to input the address that way.
Inside the docker compose
file I add another service.
my-service
logging:
driver: fluentd
options:
fluentd-address: fluentbit:24224
networks:
- monitor
I use the name of the fluentbit service here as a hostname
. But this does not work.
Does anyone know how I can get my service to push logs into fluentbit?
fluent_bit.conf
file
[SERVICE]
Flush 5
Daemon Off
Log_Level debug
[INPUT]
Name forward
Listen fluentbit
Port 24224
[OUTPUT]
Name es
Match *
Host elasticsearch
Port 9200
Index fluentbit
Type docker