Splunk Search

How to use list of authorized users from a lookup file to search who is not logged in to a specific application?

splunkn
Communicator

Im having users list in lookup file, and using the index and sourcetype I can extract one set of users.
The requirement is i want to extract the authorised users in the list (lookup here) who are not logged in to the specific application (dat indicates no logs will be in events for that specific user).
I thought of using join here. But none works..

index=A sourcetype=B app=C | stats count as total by user | fields user,total | join type=outer user [ |inputlookup users.csv | table user ] | fillnull value=0 total | eval Reason if(total>0,"Userloggedin","UserNotlogged") | table user,Reason | fields - total

Any help??? Thanks in advance

Tags (2)
0 Karma

Ayn
Legend

Couldn't you just use a subsearch?

index=A sourcetype=B app=C NOT [inputlookup users.csv | fields user] | ...

martin_mueller
SplunkTrust
SplunkTrust

Any performance penalty related to NOT is usually caused by loading events you don't actually need off disk. However, the original search loads all the events anyway, so filtering out some stuff with NOT can't be worse than loading all the events.

splunkn
Communicator

Ayn thanks for your response. But using NOT leads to lack of performance isn't it?
And one more query is there any errors in my query with OUTER join, Why the results are not coming up?

0 Karma

Ayn
Legend

I'd say out of those two, join leads to worse performance.

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...