Getting Data In

Indexing a file that was rotated midstream

tafiedler
New Member

The /var/log/messages file on one of my syslog servers was being forwarded by Splunk Universal Forwarder, as witnessed by watching the summary page and paying attention to the count, when the logrotate rotated the file to /var/log/messages-20120903. This file had 87 million lines in it and I know it was not finished at the time it was rotatated. My inputs.conf is wathing only the /var/log/messages file.

My question is, will Splunk continue to forward the contents of the rotated file to the indexer or will it now start forwarding events in the newly created /var/log/messages file?

Thanks,
Todd

Tags (1)
0 Karma

Ayn
Legend

If you set up the monitor to only read /var/log/messages, then that's the only file that Splunk is going to read. If you set it up to read the other files that messages is rotated into though (like /var/log, /var/log/messages*), Splunk will read the rotated files as well as long as they're not events that have already been seen before. Here's some info on how Splunk handles rotated files: http://docs.splunk.com/Documentation/Splunk/latest/Data/Howlogfilerotationishandled

Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...