Getting Data In

2008 Last Access time

stuartamurray
Path Finder

We've got a fairly chunky installation and generally things hum along nicely. However sometimes I get a situation where stuff is getting logged but forwarders don't forward the records!!

Reading around, it appears that Windows 2008 does NOT always update the LastAccessTime on files with open handles (like log files)!!

I am trying a work around where I use FileInfo.LastAccessTime = DateTime.Now();

I'll let you know how I get on.

Come back Linux all is forgiven

Tags (1)
0 Karma

stuartamurray
Path Finder

Ok, setting the LastAccessTime from the logger code fails as the file is opened already and you get an access exception when trying to set the flag.! So, looks like the suggestion below is the only game in town!

0 Karma

gkanapathy
Splunk Employee
Splunk Employee

You can work around this in Splunk by setting:

alwaysOpenFile = 1

in the inputs.conf stanza for the monitored file in question. This will cause Splunk to open and read the file to determine if it has changed rather than just looking at the modification time.

stuartamurray
Path Finder

Does this work for a directory monitor?

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...