All Apps and Add-ons

Is it possible to define 2 threshold based on time?

cbiraris
Path Finder

Hi Team,

I am trying to schedule a alert base on threshold for 2 time window.

100 events between 00:00 to 14:00 
20 events between   14:00 to 00:00 
 
is it possible to define 2 threshold like above ? in one alert

index=ABC sourcetype=XYZ failedlogin |stats count |where count >100   between 00:00 to 14:00 

index=ABC sourcetype=XYZ failedlogin |stats count |where count >20 between 14:00 to 00:00 

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

gcusello
SplunkTrust
SplunkTrust

Hi @cbiraris,

please try this.

index=ABC sourcetype=XYZ failedlogin 
| stats count earliest(_time) AS _time
| eval time_hour=strftime(_time,"%H")
| eval threeshold=if(time_hour<15,100,20)
| where count>threeshold

Ciao.

Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @cbiraris,

please try this.

index=ABC sourcetype=XYZ failedlogin 
| stats count earliest(_time) AS _time
| eval time_hour=strftime(_time,"%H")
| eval threeshold=if(time_hour<15,100,20)
| where count>threeshold

Ciao.

Giuseppe

cbiraris
Path Finder

Thank you @gcusello 
Its working 

0 Karma
Get Updates on the Splunk Community!

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 ...

What’s New in Splunk Cloud Platform 9.1.2308?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2308! Analysts can ...