Set Interval for input modules

View thread

casey1234

Say I wanted to run a PowerShell script on an interval using the im_exec module how would I do that?

<Input powershell>
    Module  im_exec
    Command "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
    Arg     "script goes here"
    <Exec>
       $output = $raw_event;
    </Exec>
</Input>

I can make the interval work by creating pauses in the code but then it appears as though the script process would run forever which is undesirable for efficiency and stability reasons. Is there a way to run the code on a interval, say every fifteen minutes?

Thoughts?

Thanks in advance!!