Alerting

How to Throttle a Scheduled Alert by Field?

rackersmt
Explorer

Splunk receives logs from our domain controllers, and we're wanting to trigger on accounts that have an excessive number of lockout events (event code 4740). A real-time alert causes too much load on the search head because of all the 4740 events coming in (we're a very large organization). Therefore, I've switched to a Scheduled Alert that runs hourly with an action of sending an email. I'd like to not send the email if the account that's locked out has been alerted on in the last 24 hours. Since Scheduled Alerts can't seem to throttle by field, is there a way to alert only if new domain accounts how up in the report?

Here's the basic search I'm running for the alert without throttling:

index=[index-name] EventCode=4740 earliest=-24h | rex field=_raw "(?s)(?i)Account\sThat\sWas\sLocked\sOut.+?Account\sName:\s+(?\S*)" | search NOT acct_name="Guest" | top acct_name | where count >= 50 | sort -count

Thanks!

0 Karma
1 Solution

somesoni2
SplunkTrust
SplunkTrust

Try something like this.

index=[index-name] EventCode=4740 earliest=-25h | rex field=_raw "(?s)(?i)Account\sThat\sWas\sLocked\sOut.+?Account\sName:\s+(?\S*)" | search NOT acct_name="Guest" | eval Period=if(_time>relative_time(now(),"-1h"),"New","Old" ) | stats count values(Period) as Period by acct_name  | where mvcount(Period)=1 AND  Period="New" AND count >= 50| sort -count | head 10 | fields -Period

SInce, you're running the search every hour, the new lockouts will be there in last 1 hour period only, others would've been alerted during previous hour. So, above search check if the lockout has only happened in last 1 hr (period=New) with count>50.

View solution in original post

somesoni2
SplunkTrust
SplunkTrust

Try something like this.

index=[index-name] EventCode=4740 earliest=-25h | rex field=_raw "(?s)(?i)Account\sThat\sWas\sLocked\sOut.+?Account\sName:\s+(?\S*)" | search NOT acct_name="Guest" | eval Period=if(_time>relative_time(now(),"-1h"),"New","Old" ) | stats count values(Period) as Period by acct_name  | where mvcount(Period)=1 AND  Period="New" AND count >= 50| sort -count | head 10 | fields -Period

SInce, you're running the search every hour, the new lockouts will be there in last 1 hour period only, others would've been alerted during previous hour. So, above search check if the lockout has only happened in last 1 hr (period=New) with count>50.

rackersmt
Explorer

Beautiful, thank you!

0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In the last month, the Splunk Threat Research Team (STRT) has had 2 releases of new security content via the ...

Announcing the 1st Round Champion’s Tribute Winners of the Great Resilience Quest

We are happy to announce the 20 lucky questers who are selected to be the first round of Champion's Tribute ...

We’ve Got Education Validation!

Are you feeling it? All the career-boosting benefits of up-skilling with Splunk? It’s not just a feeling, it's ...