Getting Data In

Forwarder only reads file if i save it, ignores when script saves it

LAcioffi
Explorer

Hello everyone,

I have Splunk Universal Forwarder running on a server watching a few files for changes. Log data is inserted at the end of the files every 5 minutes or so.
Up until a few days ago, all files were working and being correctly monitored. Today i noticed that a single file out of 10+ is not being monitored correctly.

When the script appends something to the file and closes it (thus updating the update date), the data doesn't arrive at the index. However, if i open the file, change anything and save it, all the data that should have arrived suddenly arrives.

This problem started out of the blue. I tried restarting the universal forwarder service, changing how the file is saved, deleting the file and letting the script re-create it, everything, but it still won't work.

Any ideas? Has this ever happened to anyone before?

P.S.: The file is open and closed explictly in my script. All other files do the same thing and work, only this one file is giving me trouble.

Thanks!

0 Karma

PavelP
Motivator

Hello @LAcioffi ,

this can be a problem with CRC calculation, so splunk doesn't notice that the file has been changed. This especially the case if the file has large header or/and is too small.

Run this command on the UF and compare the output after the file has been changed by the script:

./splunk _internal call /services/admin/inputstatus/TailingProcessor:FileStatus

if you see that this command reports wrong status and size, then you need to change crcSalt or initCrcLength in your inputs.conf

Please let me know if it worked for you

0 Karma

LAcioffi
Explorer

Hey,

I don't have permissions to do that, but i checked the forwarder logs and the admin checked for error logs on index=_internal and we didn't find anything.

0 Karma

PavelP
Motivator

Hello @LAcioffi

there are no errors in such situations.

Can you post a redacted file?

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!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...