Splunk Search

where username NOT equal to list of usernames in Lookup table

r999
Path Finder

i have some data indexed which is a snapshot of users who have access to a system.

i have uploaded a 1 column csv with a list of usernames who SHOULD have access to a system..

How do i use the lookup table to lo search:

source="user_snapshot" username != inputlookup "valid_users"

i.e i want the search to simply return list of the users who should not have access

1 Solution

Ayn
Legend

Use table.

... | table username
0 Karma

r999
Path Finder

thanks...

The only issues now is that this does not display as a table format where the first search did- just a list of events. how can i put this into a clean table of users which i can then add to a dashboard?

0 Karma

Ayn
Legend

Just switch the location of the search and the subsearch. You want to list all users in the snapshot and search for the ones that are in the snapshot but not in the lookup. I don't know what field names you're using in the lookup file, so I'm calling the relevant field here "username":

source="user_snapshot" NOT [| inputlookup valid_user.csv | fields username]
0 Karma

r999
Path Finder

hi thanks very much i actually got something working similar to the first link however that is returning the inverse of what i wanted and i cant workout how to change it...

results show "valid_users" who are not in the user snapshot

i would like to see list of users in the snapshot who are not Valid _users

how do i amend the follwing

| inputlookup valid_user.csv | search NOT [search source="user_snapshot*" | dedup username | fields username]

thanks in advance

0 Karma
Get Updates on the Splunk Community!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...