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!

Cisco Catalyst Center Meets Splunk ITSI: From 'Payments Are Down' to Root Cause in ...

The Problem: When Networks and Services Don't Talk Payment systems fail at a retail location. Customers are ...

Print, Leak, Repeat: UEBA Insider Threats You Can't Ignore

Are you ready to uncover the threats hiding in plain sight? Join us for "Print, Leak, Repeat: UEBA Insider ...

New Year, New Changes for Splunk Certifications

As we embrace a new year, we’re making a small but important update to the Splunk Certification ...