Splunk Search

How to set lower and upper threshold deviation?

majilan1
Path Finder

Hi Splunkers,

This may be easy, but I'm not able to solve it if anyone can help.

I want to set a lower threshold to 15 standard deviation below the mean, and the upper threshold to 15 standard deviation above the mean, but I'm not sure how to implement that. 

Thanks!

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

The general idea is to use the eventstats command to compute the standard deviation then use eval to calculate the lower and upper thresholds.  Like this:

| eventstats stdev(foo) as stdev, avg(foo) as avg
| eval lower=avg - stdev*15, upper=avg+stdev*15
| where (foo < lower OR foo > upper)

 

---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

majilan1
Path Finder

How would I implement that in what I do have, please? So this is what I have:

index=X  sourcetype=Y source=metrics.kv_log appln_name IN ("FEED_FILE_ROUTE", "FEED_INGEST_ROUTE") this_hour="*"

| bin span=1h _time

| stats latest(this-hour) AS Volume BY appln_name, _time

| eval day_of_week=strftime(_time,"%A"), hour=strftime(_time,"%H")

|lookup mt_expected_processed_volume.csv name as appln_name, day_of_week, hour

outputnew avg_volume, stdev_volume

0 Karma

richgalloway
SplunkTrust
SplunkTrust

The general idea is to use the eventstats command to compute the standard deviation then use eval to calculate the lower and upper thresholds.  Like this:

| eventstats stdev(foo) as stdev, avg(foo) as avg
| eval lower=avg - stdev*15, upper=avg+stdev*15
| where (foo < lower OR foo > upper)

 

---
If this reply helps you, Karma would be appreciated.
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Laser Bananas and Edge Hubs: Exploring Operational Technology (OT) Data Through a ...

  OT is a different environment to traditional IT and can have interesting challenges when interfacing the ...

Event Series: Mastering AI Tokenomics and Splunk Agent Observability

Beyond the Black Box: Correlating AI Performance and Tokenomics with Splunk Agent Observability   As ...

span_metrics: The OpenTelemetry-Idiomatic Way to See Inside Your Services

You open a trace in Splunk Observability Cloud and everything looks fine. One root span, order-pipeline, with ...