Getting Data In

Under what situation would one monitor a rolled log file?

the_wolverine
Champion

I've heard that Splunk recommends monitoring of rolled log files (eg. file.log.1, file.log.2, etc) under certain situations. What are those situations?

I would think that monitoring of file.log would be sufficient.

0 Karma

yannK
Splunk Employee
Splunk Employee

It is all about the last events recorded before the log rotated. If this is too quick, the tailing processor may have read them.
So the recommended behavior (when not using crcSalt) is to monitor the first rotated files.

Otherwise, the behavior will depend of the OS and of the type of rotation.

  • By example on linux logrotate a log file usually move to the new version (file.log -> file.log.1), so Splunk will keep monitoring the handle on the file and get the last events.
  • If the file is copied and the original deleted, then the events will not be read from the new file.
0 Karma

kristian_kolb
Ultra Champion

I'd assume that file.log.1 does not get updated - so a single pass through that file should find any events that were written just before the file was rotated. Thus there would be no real need to monitor .2 or .3 etc

0 Karma

the_wolverine
Champion
  • How does one determine if log rotate is too quick?
  • So Splunk does not recommend monitoring file.log.2, file.log.3, etc?
  • What is the recommended syntax for monitor input in this case?
0 Karma
Get Updates on the Splunk Community!

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...

Announcing the Migration of the Splunk Add-on for Microsoft Azure Inputs to ...

Announcing the Migration of the Splunk Add-on for Microsoft Azure Inputs to Officially Supported Splunk ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI! Discover how Splunk’s agentic AI ...