Splunk Search

Statistics Related

splunkrags
Engager

Hi,

I have a continuous stream of response times for a given service. A fraction of these responses can be very high due to various reasons. I would like to omit such occurrences (assuming that these are 2%) and calculate the average response time. Can this be achieved in a simple manner ? Example illustrated below:

Service Response Time (98% of the time)

A ---> 3.5 ms ( assuming values - 2,2,2,2,2,2,2,10 - needs to omit 10)

B ---> 4 ms ( assuming values - 4,4,4,4,4,5, 7,11 - needs to omit 11)

Thanks in advance

Tags (1)
0 Karma

bwooden
Splunk Employee
Splunk Employee

You can tweak acceptable parameters based on standard deviation or other stats. The below search will calculate the standard deviation of a and the existing average of a. Next we will make a null IF the value of a + standard deviation is greater than the average of a + standard deviation. Finally we filter out null values and return the average of what remains...

... | eventstats stdev(a) as stdev_a avg(a) as avg_a | eval a=if(a+stdev_a < avg_a+stdev_a, a, null()) | where isnotnull(a) | stats avg(a)
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...

Updated Data Management and AWS GDI Inventory in Splunk Observability

We’re making some changes to Data Management and Infrastructure Inventory for AWS. The Data Management page, ...