I have just installed the "td-agent-bit" service in a docker container based on "Ubuntu 22.04".It seems to be running, because when I do "sudo service td-agent-bit status" it doesn't give errors:
root@577239908ff1:/etc/td-agent-bit/logs# sudo service td-agent-bit status
Fluent Bit v1.9.10
* Copyright (C) 2015-2022 The Fluent Bit Authors
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
* https://fluentbit.io
[2024/02/20 08:28:24] [ info] [fluent bit] version=1.9.10, commit=, pid=28
[2024/02/20 08:28:24] [ info] [storage] version=1.3.0, type=memory-only, sync=normal, checksum=disabled, max_chunks_up=128
[2024/02/20 08:28:24] [ info] [cmetrics] version=0.3.7
[2024/02/20 08:28:24] [ info] [sp] stream processor started
The problem is that it doesn't write the output to into the "/etc/td-agent-bit/logs" directory. This is my configuration:
[OUTPUT]
Name file
Match *
Path /etc/td-agent-bit/logs
In the Dockerfile I create the "/etc/td-agent-bit/logs" folder and I give it all permissions:
# Create log directory
RUN mkdir -p /etc/td-agent-bit/logs
# Set permissions
RUN chmod 777 -R /etc/td-agent-bit/logs
Then I run the application which writes the logs into the "/app1/input.log" file. Here is my input configuration:
[INPUT]
Name tail
Tag mylogs
Path /app1/input.log
Mem_Buf_Limit 5MB
Skip_Long_Lines Off
Refresh_Interval 10
In my virtual machine, which is also based on Ubuntu 22.04, it works. Only in the container it doesn't work.