docker-splunk icon indicating copy to clipboard operation
docker-splunk copied to clipboard

Tailing to stdout does not follow rotated/renamed files

Open chancepants opened this issue 2 years ago • 0 comments
trafficstars

The tail command used to emit splunkd_stderr.log (or a custom log file) to stdout does not handle the file being rotated/renamed. The current command uses -f https://github.com/splunk/docker-splunk/blob/9.1.1/splunk/common-files/entrypoint.sh#L65 but likely should use -F

     -F      The -F option implies the -f option, but tail will also check to see if the file being
             followed has been renamed or rotated.  The file is closed and reopened when tail
             detects that the filename being read from has a new inode number.

In my current environment I have splunk running container image 9.0.6 and have verified the tail command is running via ps aux | grep tail and logs are actively being written to splunkd_stderr.log. I've also confirmed logs stopped being written to stdout immediately after file rotation splunkd_stderr.log -> splunkd_stderr.log.1.

chancepants avatar Oct 23 '23 17:10 chancepants