Splunk Search

WatchedFile - File too small to check seekcrc, probably truncated. Will re-read entire file

max8006
Explorer

Hello
I have a script that writes a log file of the current month. The information is exported from a database. It always writes the whole month. It does not matter if there are new entries or not. If there are new entries, they will be appended to the end of the file.
This log file is monitored by Splunk. I think the re reading takes place at the moment the script fills the line of the log file and is not finished, and at the same time Splunk checks the file and recognizes there is a difference.
My workaround is to copy the file to a different location when the script finishes exporting. And Splunk only checks the file at the new copy location. Now I do not have such reading errors anymore.
My question is whether my approach is right or if there is a better way. The problem I have is that I can not access the database directly.
thank you in advance

Tags (1)
0 Karma
1 Solution

martin_mueller
SplunkTrust
SplunkTrust

If you're rewriting files from the beginning then yeah, writing them elsewhere and finally moving/renaming them to a splunk-monitored location is the way to go.

View solution in original post

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

If you're rewriting files from the beginning then yeah, writing them elsewhere and finally moving/renaming them to a splunk-monitored location is the way to go.

0 Karma

ddrillic
Ultra Champion

Maybe you can write the output from the DB into a file and compare its contents against the Splunk's monitored file and add to the Splunk one the difference. Like this you hide your process from Splunk.

0 Karma
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 ...