Alerting

How to monitor a value and get alert when it keeping increasing after 5 events?

zoe
Path Finder

Hi, 

I would like to monitor one value of each event. When it keeps increasing after 5 events, an alarm should be triggert.  I uase autoregress to generate the difference between the current event and previous event (see below). But how can I monitor that the difference keeps being positive after five events? Thank you very much!

| autoregress C_avg as C_avg_prev
| eval C_detal=C_avg-C_avg_prev

zoe_0-1648836570239.png

 

Labels (1)
0 Karma
1 Solution

zoe
Path Finder

Hi @somesoni2 

thanks a lot! that is what I want. Thank you so much for your clear guide!

View solution in original post

0 Karma

somesoni2
Revered Legend

Try like this

| makeresults | eval C_avg="12 14 15 4 20 22 24 28 34 45 8 90" | makemv C_avg | mvexpand C_avg | table C_avg | rename comment as "Above generates sample data. replace it with your search"
| autoregress C_avg as C_avg_prev
| eval C_detla=C_avg-C_avg_prev 
| eval C_trend=if(C_avg>C_avg_prev,1,0) 
| streamstats sum(C_trend) as sum_C_trend window=5 
| where sum_C_trend=5
0 Karma

zoe
Path Finder

Hi @somesoni2 

thanks a lot! that is what I want. Thank you so much for your clear guide!

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...