Alerting

Correct way to do count over time

Vantine
Engager

Trying to set up an alert to show any log in that has had 500 log on failures in under 30 min.

 

Here is what I currently have (with non relevant data changed)

index=* sourcetype=* action=failure EventCode=4771 OR EventCode=4776 | bucket _time span=30m | stats count by user | where count>500

I want to make sure this is correct.

 

Thanks!

Labels (1)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @Vantine,

don't use timechart:

index=eits_wineventlog_security sourcetype=WinEventLog (EventCode=4771 OR EventCode=4776)
| bin span=60m _time
| stats count BY user _time
| where count>5

Ciao.

Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @Vantine,

yes it's correct.

You're speaking of windows log so you could simplify (and make faster) your search in this way:

index=wineventlog sourcetype=wineventlog EventCode=4771 OR EventCode=4776 
| timechart span=30m count by user 
| where count>500

Ciao.

Giuseppe

Vantine
Engager

Wasnt getting results, so I went longer and smaller errors. Still not getting anything.

Here is how I have it

index=eits_wineventlog_security sourcetype=WinEventLog  EventCode=4771 OR EventCode=4776

| timechart span=60m count by user
| where count>5

I know for sure we have had enough failures to at least get a few.

Thanks

 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Vantine,

don't use timechart:

index=eits_wineventlog_security sourcetype=WinEventLog (EventCode=4771 OR EventCode=4776)
| bin span=60m _time
| stats count BY user _time
| where count>5

Ciao.

Giuseppe

Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Introducing ITSI 5.0: Unified Visibility and Actionable Insights

Introducing ITSI 5.0: Unified Visibility and Actionable Insights Tuesday, July 21, 2026  |  10:00AM PT / ...

Inside Splunk Agent Observability: Understanding Agent Behavior, Tokens & Costs

Inside Splunk Agent Observability:Understanding Agent Behavior, Tokens & Costs Thursday, August 06, ...

From Data to Insight: Announcing the Winners of the Splunk Dashboard Contest

Hi Splunkers, First off, thank you to everyone who participated in our very first From Data to Insight: The ...