Alerting

How to trigger alert if new file is created in empty folder?

SplunkCSIT
Communicator

Hi,

What will be the search if I wish to create an alert such that it triggers an alert when there is a file created in an empty folder? thks

Tags (1)
0 Karma

MuS
Legend

Hi SplunkCSIT,

in inputs.conf you have to setup a monitor stanza for this directory / folder and assign a sourcetype. After that you can search for this sourcetype like this

 sourcetype=yourmonitoresourcetype

and when ever there is an event, fire an alert - done.

hope this helps ...

cheers, MuS

MuS
Legend

a monitor in inputs.conf will monitor continuously the defined folder, if you want to have a cron like check use scripted in inputs.
Why is it not working? check the permission on the folder, check splunkd.log for errors related to this path.
btw followTail = 0 is not needed in your case.

SplunkCSIT
Communicator

Hi,if i wish to monitor the folder every 7mins, alert when there is a file created in d:\check, is the below monitor correct? If so, how come it dont work? thks

[monitor://D:\check]
disabled = false
followTail = 0
index = monitorfolder
sourcetype = monfolder
0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...