Splunk Search

Can you help me use the where command to limit results?

muzicman61
New Member

I have a search that works perfectly. It lists the number of calls by area code by state. However, I'm trying to limit the results to only display area codes that have 500 or more hits.

Here's my search...

sourcetype="VHT:HPIQ:IVROutput" DNIS  "Success" | eval ac=substr(DNIS,2,3) | lookup areacode.csv areacode as ac OUTPUT state | stats count(ac) by state | sort -count(ac)

I've tried using the where command, but I can't seem to get the syntax correct. I'm sure it's a very simple answer but I am only 1 month into my Spunk learning.

Thanks for the help.

Tags (1)
0 Karma
1 Solution

renjith_nair
Legend

@muzicman61,
Try,

sourcetype="VHT:HPIQ:IVROutput" DNIS "Success" | eval ac=substr(DNIS,2,3) | lookup areacode.csv areacode as ac OUTPUT state 
| stats count(ac)  as ac by state | where ac>=500
---
What goes around comes around. If it helps, hit it with Karma 🙂

View solution in original post

0 Karma

renjith_nair
Legend

@muzicman61,
Try,

sourcetype="VHT:HPIQ:IVROutput" DNIS "Success" | eval ac=substr(DNIS,2,3) | lookup areacode.csv areacode as ac OUTPUT state 
| stats count(ac)  as ac by state | where ac>=500
---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma

muzicman61
New Member

Thank you... I was close but it kept giving me errors. I knew the solution would be simple.

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...