fluent-bit: Cannot tail log files mounted through docker compose volume properly
Bug Report
Describe the bug
Following is the set up.
- An app server writes a log in /shared/logs/app.log file from host
- /shared is mounted via docker volume
- fluentbit:1.5 is running inside the docker container.
Fluentbit server is up and running. It recognizes the input and output.
When the server writes log to the file fluentbit cannot detect the change.
If the app server is closed(terminated) fluentbit recognises the change sends the accumulated log. If I touch app.log then also fluentbit recognises the change.
If I simply run tail -f inside the container then tail picks up the log without having to do touch app.log
To Reproduce
docker-compose.yml
version: '3'
services:
logserver:
build:
context: ./services/fluentbit
volumes:
- ./shared:/shared
container_name: fluentbit
# The following picks up the log properly
# image: ubuntu
# command: tail -F /shared/logs/app.log # build:
# volumes:
# - ./shared:/shared
fluent-bit.conf
[SERVICE]
log_level debug
Daemon off
Flush 5
Parsers_File parser.conf
# Retrieve valid JSON text messages over file interface
[INPUT]
Name tail
Path /shared/logs/app.log
DB /shared/fluentbit.db
Tag applog
[INPUT]
Name tail
Path /shared/logs/service.log
DB /shared/fluentbit.db
Tag servicelog
[FILTER]
Name parser
Parser docker
Match *
Key_Name log
Reserve_Data On
[OUTPUT]
Name es
Match applog
Host ${HOST}
Port ${PORT}
Index ${IDX}_app
Type app
tls On
tls.verify Off
HTTP_User ${USER}
HTTP_Passwd ${PWD}
Include_Tag_Key On
Tag_Key tag
[OUTPUT]
Name es
Match servicelog
Host ${HOST}
Port ${PORT}
Index ${IDX}_service
Type service
tls On
tls.verify Off
HTTP_User ${USER}
HTTP_Passwd ${PWD}
Include_Tag_Key On
Tag_Key tag
Expected behavior
Whenever server writes log in the file fluentbit should pick up the changes (with some buffer) and post it to output. Rightnow the changes are not picked up unless touch app.log is done.
Your Environment
- Version used: https://hub.docker.com/layers/fluent/fluent-bit/1.5/images/sha256-d786044272c6b64e4d587010c5b1ea4f8ec86c4060055012b66e0446ad2cce44?context=explore
- Configuration: Mentioned above
- Environment name and version (e.g. Kubernetes? What version?): Docker-compose
- Server type and version:
- Operating System and version: maos catalina
- Filters and plugins: in_tail / out_es
Additional context
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 6
- Comments: 16 (2 by maintainers)
Same issue. Why is this issue closed? I can
catthe logfile, so I guess it is not a permission or containerd (Linux host) issue. Version: 1.9.3-debugI am having the same issue (not docker compose, just docker volume)