Splunk Search

How to do a comparison with lookup?

bosseres
Contributor

Hello everyone, 

I have events which contains such fields user1=..., user2=...., user3... etc

And I have lookup which have column "user" where located all users.

 

 

Labels (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @bosseres ,

let me understand: in your events you have many different fields as user1=..., user2=... etc..., is it correct?

how much fields do you have?

are they present in all events or they are only one for each event?

if you have only one field in each event, you could try to search for the content of a lookup where there is a column called "user" containing a list of users, using the coalesce option in the evel command, something lie this:

<your_search>
| eval user=coalesce(user1,user2,user3)
| search [ | inputlookup your_lookup.csv | fields user ]
| ...

Ciao.

Giuseppe

bosseres
Contributor

nono, I have many different such fields

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @bosseres ,

if you have many fields in the same event, you have to search using the lookup for each field.

Ot there could be a workaround:

<your_search> [ | inputlookup your_lookup.csv | rename user AS query | fields query ]
| ...

Ciao.

Giuseppe

Get Updates on the Splunk Community!

What’s New & Next in Splunk SOAR

Security teams today are dealing with more alerts, more tools, and more pressure than ever.  Join us on ...

Your Voice Matters! Help Us Shape the New Splunk Lantern Experience

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

September Community Champions: A Shoutout to Our Contributors!

As we close the books on another fantastic month, we want to take a moment to celebrate the people who are the ...