Splunk Search

How to get result for field value difference?

EvansB
Path Finder

Working with this query, I'm hoping to get only results where field values are greater than the other.

 

 

index="index*"
| eval MonthNumber=strftime(_time,"%m") 
| chart eval(round(avg(durationMs), 0)) AS avg_durationMs by properties.url, MonthNumber 
| rename 04 AS "Apr", 05 AS "May"

 

 

 I want to get only results of where Apr values is greater than May by 10

EvansB_1-1653334771444.png

 

Labels (1)
Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

If you only want to see results where the "May" number is greater than the "Apr" number then add a where command to the query.

| where May > Apr

 

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

EvansB
Path Finder

This gives me general results. I need results that are only greater than 10 and beyond. This is for the purpose of setting up an alert when values between May and Apr is greater than 10

Thanks

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Change the where command to test for the desired difference.

 

| where May > Apr+10

 

 

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

EvansB
Path Finder

Appreciate your assistance

0 Karma
Get Updates on the Splunk Community!

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

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...

Index This | When is October more than just the tenth month?

October 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...