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!

A Four-Part Event Series: Full Stack Observability For the AI Era

As AI reshapes applications, infrastructure, and the way teams operate, the traditional boundaries of ...

SOC4Kafka - New Kafka Connector Powered by OpenTelemetry

The new SOC4Kafka connector, built on OpenTelemetry, enables the collection of Kafka messages and forwards ...

Event Series: Level up your SOC: Advancing with Splunk Enterprise Security

AI has fundamentally raised the stakes for security operations, and this three-part series is your guide to ...