Getting Data In

Log File Rotation causing new file to not ingest

TRobertshaw
New Member

We have a file that is rotated at midnight every night.  The file is renamed and zipped up. 

Sometimes after the log rotation Splunk does not ingest the new file.

There are no errors in the Splunkd log relating to crc or anything along those lines.

A restart of Splunk resolves the issue however we would like to find a more permanent solution.

We are on UF version, 9.0.4.

 

Appreciate any suggestions you may have

Labels (2)
0 Karma

PickleRick
SplunkTrust
SplunkTrust

Are you sure that the file is _rotated_ (as in renamed and compressed)? Because that behaviour is pretty consistent with the "copytruncate" behaviour of logrotate when the contents of the file are copied out to a new file and the file is truncated afterwards. In such case the file descriptor does not change but Splunk suddenly finds itself after the end of the data so most probably assumes that it had already read all the data there was.

0 Karma

TRobertshaw
New Member

Is there a way to allow Splunk to refresh and review the new file everytime?

0 Karma

PickleRick
SplunkTrust
SplunkTrust

You'd have to restart the forwarder service after logrotate. (Because I assume that's what you're using). Just like normally you kill -HUP your syslog daemon.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Introduction to Splunk AI

How are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. Lucky for ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Maximizing the Value of Splunk ES 8.x

Splunk Enterprise Security (ES) continues to be a leader in the Gartner Magic Quadrant, reflecting its pivotal ...