Splunk Search

Trying to find events greater than the average wtih streamstats

pp_mills
New Member

Hi Guru's. I am trying to find events greater than the average of the last 10. I also want to display my results in a table. It doesn't work.
Here is my search string.

index="mydata" |streamstats avg(totalms) as myavg current=f window=10|search totalms>myavg |table totalms myavg

Tags (1)
0 Karma

bwooden
Splunk Employee
Splunk Employee

In this case, you may get better results using the where command which uses eval expressions to filter results.

index="mydata" 
  | streamstats avg(totalms) as myavg current=f window=10 
  | where totalms>myavg 
  | table totalms myavg
0 Karma

pp_mills
New Member

That worked perfectly!
thanks so much. My wife thanks you too. I get to go home now 🙂

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 ...