Splunk Search

Query to return events whose count is more than 3 times standard deviation,Find outlier events, using different time ranges for events and for stats

kalua
New Member

I am trying to write a query which returns the values in myCol which have a count greater than 3 times the standard deviation of the counts of values in myCol. I tried the following:

source="mySource" | stats count as myCount by myCol | append [ | search source="mySource" | stats count as myCount by myCol | stats stdev(myCount) as deviation ] | eval outlier=deviation*3 | stats values(myCount) as myCount, values(outlier) as outlier | where myCount > outlier | table myCol, myCount

However, no results are returned. How can I achieve this?

Tags (1)
0 Karma

woodcock
Esteemed Legend

Try this as the core of your search:

source="mySource" | stats count as myCount by myCol | eventstats stdev(myCount) as deviation | eval outlier=deviation*3 | where myCount > outlier
0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...