Splunk Search

How to create Splunk search for getting average of max per 10mins?

ayushig
New Member

Hi team

I am trying to create a query in order to get average of all max values in a period of 10 mins for any selected time range. (7 days) per host.

There are multiple hosts and searching a log text in splunk. Then using the log events count I am trying to figure out how many times did the event occurred/ host was called. 

For my query I want to take average of all the max values  per 10 min period over the selected time-range per host.

(AVG(MAX PER 10 MIN) FOR SELECTED TIME RANGE) BY HOST

Labels (2)
Tags (1)
0 Karma

bowesmana
SplunkTrust
SplunkTrust

to get a rolling 10 minute figure, you will need streamstats, but to get a static 10 minute average you can use bin/stats, e.g. see this example which simply calculates the time diff between every event. It then buckets time per 10 minutes then takes the max value of diff and finally takes the average of that value

index=_audit
| delta _time as diff
| eval diff=-diff
| bin _time span=10m
| stats max(diff) as diff by _time host
| stats avg(diff) by host

 Hopefully you can fit that to your requirement

0 Karma
Get Updates on the Splunk Community!

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

🔐 Trust at Every Hop: How mTLS in Splunk Enterprise 10.0 Makes Security Simpler

From Idea to Implementation: Why Splunk Built mTLS into Splunk Enterprise 10.0  mTLS wasn’t just a checkbox ...