Getting Data In

Issues with Splunk trying to open a file during a copy process

dshakespeare_sp
Splunk Employee
Splunk Employee

Customer is using a script that extracts the logs from the local SQL instance into a text file. When the extraction is complete, the script copies the file over to a folder being monitored by a Splunk forwarder.

The customer is not always seeing the logs come through to the index and looking in splunkd.log on the forwarder they see the following:

05-24-2012 01:07:41.028 +0100 WARN TailingProcessor - Will retry file='f:\SplunkMonitor\WebProxy\system1_99999523.txt' in 10000ms due to: The process cannot access the file because it is being used by another process.

05-24-2012 01:07:51.031 +0100 ERROR TailingProcessor - Ignoring path due to: failed to open for checksum: 'd:\SplunkMonitor\WebProxy\system1_99999523.txt' (The process cannot access the file because it is being used by another process.)

It appears Splunk is trying to read the file whilst it is still being copied over. The file can’t be red because it is locked during the copy process, retries again in 10000ms, fails again because the copy isn’t complete and then gives up.

Is the 10000ms retry period configurable?

Tags (3)

dshakespeare_sp
Splunk Employee
Splunk Employee

The 10000ms limit is currently hard-coded.
There is a enhancement ticket currently logged with Splunk:-
SPL-46229 - Add a configurable backoff interval to file monitoring.

It is hoped resolution to this issue using an improved backoff algorithm will be available shortly in a upcoming maintenance release of Splunk 4.3.x

A possible workaround to this issue would be modify the copy script to copy the file to a non monitored directory and call "splunk add oneshot"

See
http://docs.splunk.com/Documentation/Splunk/4.3.2/Data/MonitorfilesanddirectoriesusingtheCLI

Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...