Getting Data In

Ingesting file data

bcross64
Explorer

I have a Powershell script that is writing data about sessions for an application to a file every 5 minutes so the file timestamp is changing, but Splunk only pulls in changed or new sessions. I was hoping Splunk would pull in all the data every 5 minutes so that I could get a good point-in-time count of the number of sessions and what they looked like at that time. Does anyone know if I can force Splunk to ingest the entire file when it changes? Here is the code I use to write a powershell object to a Splunk friendly file in case anyone is interested. "Id" is where the line break should be.

($obj | fl | Out-String).Trim() -replace "nrn","" -replace "rn","," -replace " :","=" -replace " +"," " -replace "(?m)^Id","nId" | Set-Content $file

1 Solution

Ayn
Legend

Change the CHECK_METHOD for the file in props.conf. Any other than the default method will cause Splunk to index the entire file if it's changed. From the docs:

CHECK_METHOD = [endpoint_md5|entire_md5|modtime]
* Set CHECK_METHOD endpoint_md5 to have Splunk checksum of the first and last 256 bytes of a
  file. When it finds matches, Splunk lists the file as already indexed and indexes only new
  data, or ignores it if there is no new data.
* Set CHECK_METHOD = entire_md5 to use the checksum of the entire file.
* Set CHECK_METHOD = modtime to check only the modification time of the file.
* Settings other than endpoint_md5 cause Splunk to index the entire file for each detected
  change.
* Defaults to endpoint_md5.

So, you should do something like:

[source::<yoursource>]
CHECK_METHOD = modtime

View solution in original post

Ayn
Legend

Change the CHECK_METHOD for the file in props.conf. Any other than the default method will cause Splunk to index the entire file if it's changed. From the docs:

CHECK_METHOD = [endpoint_md5|entire_md5|modtime]
* Set CHECK_METHOD endpoint_md5 to have Splunk checksum of the first and last 256 bytes of a
  file. When it finds matches, Splunk lists the file as already indexed and indexes only new
  data, or ignores it if there is no new data.
* Set CHECK_METHOD = entire_md5 to use the checksum of the entire file.
* Set CHECK_METHOD = modtime to check only the modification time of the file.
* Settings other than endpoint_md5 cause Splunk to index the entire file for each detected
  change.
* Defaults to endpoint_md5.

So, you should do something like:

[source::<yoursource>]
CHECK_METHOD = modtime
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 ...