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!

Splunk Enterprise Security: Your Command Center for PCI DSS Compliance

Every security professional knows the drill. The PCI DSS audit is approaching, and suddenly everyone's asking ...

Developer Spotlight with Guilhem Marchand

From Splunk Engineer to Founder: The Journey Behind TrackMe    After spending over 12 years working full time ...

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 ...