Splunk Search

appen empty values to results in lookup

bluewizard
Explorer

I have the following search to track search usage, i have a list of user who i want to track in a csv file. However, how do I add values that are in csv but not in my base search?  As in my base search some users are have 0 count. 

im getting the following:

username|count

userA|100

userB|200

I would like to add missing user name in the lookup to my results like below:

username|count

userA|100

userB|200

userC| 0

userD| 0

 

| tstats `summariesonly` count from datamodel=Splunk_Audit.Search_Activity where (Search_Activity.info="granted" OR (Search_Activity.info="completed" Search_Activity.search_type="subsearch"))    by Search_Activity.user | rename Search_Activity.* as * | sort  + count
| lookup ess_analyst_list.csv username as user OUTPUT username as users
| where !isnull(users)
| fields - users

 

 

 

 

 

Labels (1)
0 Karma

PickleRick
SplunkTrust
SplunkTrust

Splunk cannot find what is not there 🙂 So you have to provide it with a "synthetic" values.

https://www.duanewaddle.com/proving-a-negative/

0 Karma

bluewizard
Explorer

User C and User D is in the lookup (csv), anyway to add them if their are not in my base search and eval as "0"

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