Alerting

How to alert on comparison of two fields in a single search?

jaewankim
New Member

I am trying to monitor a log and alert when a certain value spikes higher than usual.
trendline seems to be useful here.

Something like

|stats count, avg(concurrent_user) as user_count by date_minute, date_second |trendline sma10(user_count) as user_count_moving_average

can provide both single value in user_count and a moving average.

How can I set up an alert that can compare the two values, so that if the single value is much greater than the moving average?
I can calculate moving average of different periods and make the comparison as well. I get the search right, but the custom condition on alert setup is baffling me.

0 Karma

vasanthmss
Motivator

use the where class to find your matching records, something like this,

|stats count, avg(concurrent_user) as user_count by date_minute, date_second |trendline sma10(user_count) as user_count_moving_average | where user_count_moving_average <=count

in the saved search schedule it when more than one events presents.

Hope this will helps you.

V

adrien_dereumau
Path Finder

I know it's been a long time since you answered, but your answer helped me at least, well done!

0 Karma
Get Updates on the Splunk Community!

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...

Get ready to show some Splunk Certification swagger at .conf24!

Dive into the deep end of data by earning a Splunk Certification at .conf24. We're enticing you again this ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Now On-Demand Join us to learn more about how you can leverage Service Level Objectives (SLOs) and the new ...