Splunk Search

Savedsearch - alternative to CRON job?

GregSmith
Explorer

I have a savedsearch running on a 5 minute cron schedule iteratively working through a list of previously saved search parameters.

2 Things

(1) Can I have a conditional CRON schedule such that I somehow detect when work needs to be performed and if so, enable the CRON? The processing for a day may take 6 hours, but the CRON keeps running and burning resources.

(2) Some of the savedsearches run in < 1 min but others take longer than 5 minutes. Instead of using a CRON schedule, can I detect the savedsearch ID, detect when it has completed and then initiate the subsequent execution of the savedsearch on the next batch of data?  

Labels (1)
Tags (2)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

1) Cron runs continuously.  There's no way to change that.  Checking whether it's time to run a cron job is likely to be far less resource-intensive than checking if work needs to be performed.

2) You may be able to use the Splunk SDK/API to detect when a search completes and then trigger a subsequent search.

---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

1) Cron runs continuously.  There's no way to change that.  Checking whether it's time to run a cron job is likely to be far less resource-intensive than checking if work needs to be performed.

2) You may be able to use the Splunk SDK/API to detect when a search completes and then trigger a subsequent search.

---
If this reply helps you, Karma would be appreciated.
0 Karma

GregSmith
Explorer

Thank you Rich. Good pointers. When I come up for air, I will pursue the SDK/API path. 

Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...