Splunk Search

How to filter my search and only return results if response time is greater than median time?

xvxt006
Contributor

Hi,

I would like to get results only if response time is greater than median time. I have used below query. But for some reason it shows all the values. Also can you let me know if this is efficient way of doing it?

my search | eventstats p50(Time1) as Time | append [search my search| where Time1> Time | stats count by Server,Env,URI,Time1 ] | table Server,Env,URI,Time1

1 Solution

MuS
SplunkTrust
SplunkTrust

Hi xvxt006,

try something like this:

my search | stats p50(Time1) as pTime by Server, Env, URI, Time1 | where Time1 > pTime | table Server, Env, URI, Time1

hope that helps ...

cheers, MuS

View solution in original post

MuS
SplunkTrust
SplunkTrust

Hi xvxt006,

try something like this:

my search | stats p50(Time1) as pTime by Server, Env, URI, Time1 | where Time1 > pTime | table Server, Env, URI, Time1

hope that helps ...

cheers, MuS

xvxt006
Contributor

Hi Mus,

I had tried like that but it is not really calculating median time for all the data points as we have stats by server, Env, URI, Time1. Each data point shows its Time value as median value which i don't want.

0 Karma

MuS
SplunkTrust
SplunkTrust

okay, just tested something similar and it works ... try this:

my search | eventstats p50(Time1) as pTime  | where Time1 > pTime | table Server, Env, URI, Time1

xvxt006
Contributor

Thanks. I have tried this previously and for some reason it did not work. Now it worked. Thanks for your help.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...