Splunk Search

Using stats command to return 0 value

mdeterville
Path Finder

Hi There:

I'm trying to return the list of access_users with 0 web hits from the web_hits table. 

How can i adjust this query to return the list of users with no hits from the web_hits table?

Thanks in advance!

 

| inputlookup web_hits.csv

| lookup local=t access_users.csv user OUTPUT user as access_user

| search access_user="*"

| stats count as num_webhits by access_user


Labels (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

The stats command can't count what isn't there so you won't get a zero.  This query returns those access_users that are not in the web_hits table.

| inputlookup local=t access_users.csv where NOT [| inputlookup web_hits.csv | fields user | rename user as access_user | format ]

 

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

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

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...