Alerting

Alert on low average when comparison with other events

sahil237888
Path Finder

Hi,
Please help.

Step1 : Calculate combined average of an event (event name : mytest here) from source file a,b,c.
Step 2 : calculate average of mytest event from each soucve file a,b,c individually.
Step 3 : compare if there is 50% change when comparing individual average with combined average.

Tags (1)
0 Karma
1 Solution

erikahanlon
Engager

It sounds like you want to use something like eventstats for what you're trying to accomplish. Eventstats gives you a way of "zooming out" and giving you metrics from the wider set of events to use for comparison to values in individual events.

Try something like this:

<base search>
| stats avg(fieldName) as source_average by eventName, source 
| eventstats avg(source_average) as combined_average by eventName 
| eval pct_diff=abs(100*(combined_average-source_average/combined_average))
| where pct_diff > 50

View solution in original post

0 Karma

erikahanlon
Engager

It sounds like you want to use something like eventstats for what you're trying to accomplish. Eventstats gives you a way of "zooming out" and giving you metrics from the wider set of events to use for comparison to values in individual events.

Try something like this:

<base search>
| stats avg(fieldName) as source_average by eventName, source 
| eventstats avg(source_average) as combined_average by eventName 
| eval pct_diff=abs(100*(combined_average-source_average/combined_average))
| where pct_diff > 50
0 Karma

sahil237888
Path Finder

@erikahanlon,

Thanks.
This gave me clue for implementing this.

0 Karma
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!

How much can you really learn in 3 minutes?

Observability can certainly be hard to understand – there's a lot of jargon and buzzwords and it seems to ...

Event Series: The Agentic SOC: Trust Before Autonomy

AI is fundamentally changing security operations, but true progress requires more than just automation—it ...

Free Professional Services for .conf26 Attendees

This year at .conf26, we are doing something a little different. We are bringing the best minds from ...