Splunk Search

How to compare a compare a field in an event with a field in a lookup?

newbiesplunk
Path Finder

Hi,

I wish to do a comparison of the field in the event with the lookup to determine the occurrence of the field in the lookup? thks

Tags (1)
0 Karma

kml_uvce
Builder

try this
index=index name [|inputlookup lookupfilename|table fieldname]|table fieldname

0 Karma

newbiesplunk
Path Finder

Hi,
If i want to display all the columns in the lookup, and the stats of the column from the event as shown in next example, the lookup file have only one column "ownername", what will be the approach?

result of the search:

ownername # of car
tom

harry 1
Kim 2
John

0 Karma

newbiesplunk
Path Finder

Hi, for better understanding your answers.
Lookup filename: test33
Firstname,secondname,gender

If my event contain only the name and gd,

if index=index name [|inputlookup test33|table secondname,gender]|table name, gd correct?
thks

0 Karma

newbiesplunk
Path Finder

i want to compare secondname in lookup table with name in the event. And gender in lookup table with gd in the event. So there might be a case whereby gd and/or name in the event is empty.

0 Karma

kml_uvce
Builder

try this
index=index name [|inputlookup test33|rename secondname AS name|rename gender AS gd|table name, gd]|table name, gd

0 Karma

newbiesplunk
Path Finder

Hi,
The result show two column with name, gd only. how do i know which info is shown in lookup and not in event? thks

0 Karma

kml_uvce
Builder

please explain me which field names in event and lookup table ,you want to do the comparison

0 Karma
Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

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

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...