Getting Data In

Is it possible to set up a schedule to index all files in a directory?

Ari_McEwing
New Member

Hello Splunk Community,

I am having difficulty monitoring a local directory on my machine. The files are not getting updated. Instead, new files are being added to the directory. Is it possible set up a schedule that indexes all files in a directory? All files are .csv's and are formatted the same way (I.e. same columns in each file). I'd like for Splunk to "monitor" the directory for new files and immediately index them as a certain type under a certain host. Can this be done?

Thanks

0 Karma

somesoni2
Revered Legend

This is how I did similar thing

1) Created a scripted input which will run at a cron schedule, which will copy all the files from that folder to a new directory (accessible to splunk).
2) Created a 'batch' type monitoring input to monitor all the files in the new directory and delete it after that.

[batch://Path/to/new/directory]
...other settings...
crcSalt = <SOURCE>
move_policy =  sinkhole
0 Karma

somesoni2
Revered Legend

This will cause a duplicate copy of all files be available in the servers, so ensure you've ample space in the filesystem you'll be copying the files to.

0 Karma

Ari_McEwing
New Member

What do you mean by "a new directory (accessible to Splunk)"? Is this in reference to a source where Splunk is monitoring a local directory? My main issue is that files added to a Directory being monitored are not being indexed and are not updating with my dashboards.

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...