Getting Data In

How to detect a deleted log

pkeller
Contributor

I think some of my forwarders may be experiencing cases where logs are being removed before all events have been forwarded. Is there a string to look for in splunkd.log or possibly recommendations for increased logging levels to detect when splunkd encounters a situation where a file it has been monitoring no longer exists?

Tags (1)
1 Solution

Yasaswy
Contributor

Hi,
This is an interesting question and it would be very useful to have something in Splunk to able to spot this. However from Splunk's standpoint there is no end of file as the logs will be continued to be written to unless the file gets rotated or deleted. So a missing file is nothing abnormal. Additionally reading log file should be much faster than data being written to them. So I don't think there is currently any available setting in Splunk that would record the incident where a log file has been deleted before fully read ..... as Splunk would treat a missing log file as completely read (and it's rotated or deleted by a batch process).

The info on what data inputs are being monitored would be available from the rest calls (URI Reference) but I don't think it will be of much help in this case. What makes you think that these log files are not fully read? Are they big files being moved to a specific input location and then deleted by a batch process?

View solution in original post

0 Karma

Yasaswy
Contributor

Hi,
This is an interesting question and it would be very useful to have something in Splunk to able to spot this. However from Splunk's standpoint there is no end of file as the logs will be continued to be written to unless the file gets rotated or deleted. So a missing file is nothing abnormal. Additionally reading log file should be much faster than data being written to them. So I don't think there is currently any available setting in Splunk that would record the incident where a log file has been deleted before fully read ..... as Splunk would treat a missing log file as completely read (and it's rotated or deleted by a batch process).

The info on what data inputs are being monitored would be available from the rest calls (URI Reference) but I don't think it will be of much help in this case. What makes you think that these log files are not fully read? Are they big files being moved to a specific input location and then deleted by a batch process?

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...