Splunk Enterprise

Source log events not forwarded after log rotation

lpolo
Motivator

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

Labels (1)
Tags (1)
0 Karma

lpolo
Motivator

We have identified the issue.
The problem was caused because lumberjack not updating the file descriptor.

Thanks.

0 Karma

venkatasri
SplunkTrust
SplunkTrust

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!

 

0 Karma

codebuilder
Influencer

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:

----
An upvote would be appreciated and Accept Solution if it helps!
0 Karma

lpolo
Motivator
initCrcLength config stanza ws tried too.

I clearing the fish bucket should do the trick.
Thanks 

Tags (1)
0 Karma

codebuilder
Influencer

Also, here is some additional documentation on log rotation:

https://docs.splunk.com/Documentation/SplunkCloud/latest/Data/Howlogfilerotationishandled

----
An upvote would be appreciated and Accept Solution if it helps!
0 Karma
Get Updates on the Splunk Community!

Splunk Answers Content Calendar, June Edition

Get ready for this week’s post dedicated to Splunk Dashboards! We're celebrating the power of community by ...

What You Read The Most: Splunk Lantern’s Most Popular Articles!

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

See your relevant APM services, dashboards, and alerts in one place with the updated ...

As a Splunk Observability user, you have a lot of data you have to manage, prioritize, and troubleshoot on a ...