Issue:
Source log events not forwarded after log rotation.
Splunk UF version:
/opt/splunk# /opt/splunk/bin/splunk version
Splunk Universal Forwarder 7.0.0 (build c8a78efdd40f)
Inputs.conf:
[monitor:///var/lib/origin/openshift.local.volumes/pods/*/volumes/kubernetes.io~empty-dir/applog/pipe-co.log]
sourcetype = pipe-co
ignoreOlderThan = 12h
crcSalt = <SOURCE>
index = pipe
disabled = false
Trie
Splunk UF PID:
ps -ef | grep -i splunk | grep -v grep
root 75265 75137 1 19:19 ? 00:00:56 splunkd -p 8089 start
ls -al /var/lib/origin/openshift.local.volumes/pods/e43d5812-ebe7-11eb-bf87-48df374d0d30/volumes/kubernetes.io~empty-dir/applog/
total 4876
drwxrwsrwx. 2 root 1000100000 187 Jul 23 20:13 .
drwxr-xr-x. 3 root root 20 Jul 23 18:57 ..
-rw-r--r--. 1 1000100000 1000100000 960597 Jul 23 20:06 pipe-co-2021-07-23T20-06-16.710.log.gz
-rw-r--r--. 1 1000100000 1000100000 964929 Jul 23 20:09 pipe-co-2021-07-23T20-09-57.963.log.gz
-rw-r--r--. 1 1000100000 1000100000 963195 Jul 23 20:13 pipe-co-2021-07-23T20-13-26.509.log.gz
-rw-r--r--. 1 1000100000 1000100000 2021943 Jul 23 20:14 pipe-co.log
Any idea?
Thanks
We have identified the issue.
The problem was caused because lumberjack not updating the file descriptor.
Thanks.
Hi @lpolo
crcSalt is not recommended for rotating files, you can remove that setting and clear the fish bucket and restart the UF to start reading file.
splunk cmd btprobe -d $SPLUNK_HOME/var/lib/splunk/fishbucket/splunk_private_db --file $FILE --reset
Hope this helps!
If your log file contains a common header that is greater than 256 bytes then Splunk won't recognize it as new. If that is the case you can use initCrcLength to compensate. See the documentation below.
https://docs.splunk.com/Documentation/Splunk/latest/Admin/Inputsconf#MONITOR:
initCrcLength config stanza ws tried too.
I clearing the fish bucket should do the trick.
Thanks
Also, here is some additional documentation on log rotation:
https://docs.splunk.com/Documentation/SplunkCloud/latest/Data/Howlogfilerotationishandled