All Apps and Add-ons

How do I send an alert when the last 7 events of "fieldname" are increasing?

marvinlee93
Explorer

I would like to send an alert when the last 7 events of "fieldname" are increasing.

And a table/timechart to display the time, indexes when it happens.

Anybody knows how to do this?

Tags (1)
0 Karma

whrg
Motivator

Perhaps streamstats can help you here.

I just played around with this search:

| makeresults count=20 | eval value=random()%100
| streamstats window=2 min(value) as minimum
| eval is_increase=if(value!=minimum,1,0)
| streamstats window=7 sum(is_increase) as increases

Now when searching for "increases>=7" should give you 7 subsequent increases.

0 Karma

marvinlee93
Explorer

Hi, it's working. Thank you! Just to check this comment '| streamstats window=7 sum(is_increase) as increases
' means that the maximum count of INCREASES will only be 7? since the window size is 7?

whrg
Motivator

True, the maxium count will only be 7. So it should be "search increases=7" instead of "search increases>=7".

I modified the search a little to make it somewhat easier:

| makeresults count=20 | streamstats count | eval value=random()%100
| streamstats current=false last(value) as previous
| eval diff=value-previous
| search diff!=0
| tail 7
| stats count(eval(diff>0)) as increases

0 Karma
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...