All Apps and Add-ons

How to use values in one column to verify if logged in users in another column have been pre-authorized?

qazwsxedc994
Explorer

So I have a search which produces a table like this:

index=* source=/var/log/secure | table Loggedin_user, host_ip, timestamp | sort by Loggedin_user | WHERE timestamp NOT NULL | WHERE host_ip NOT NULL | append[dbxquery connection=splunkdb query=SELECT%20name%20FROM%20users]| fields - _raw, _time | rename "(001) users.name.VARCHAR" as "username"

Output

Loggedin_user   host_ip       timestamp         username
admin           192.168.1.10     Aug 18 09:36:08     
root            192.168.1.105   Aug 18 08:58:3             
                                                      admin
                                                    adam
                                                      test
                                                      root

What I'm looking to do is use the username column to verify whether the user logged in has been pre-authorized so I would have an output like such:

Loggedin_user   host_ip       timestamp   pre-authorized
admin           192.168.1.1   Aug 18      yes
root            192.168.1.1   Aug 18      yes
user            192.168.1.1   Aug 18      no

Is there a way I can go through the username column comparing each field to the whole Loggedin_user column?

0 Karma

woodcock
Esteemed Legend
0 Karma
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 ...