Splunk Search

Search based on list of values in a lookup table

bregan84
Engager

Hi,

The usual way of using lookup tables is to get a value from a searh, do a lookup in a lookup table and output a value from a different column if it matches.

The traditional method would be sourcetype=xxx | lookup lookup.csv cs_host as cs_host OUTPUT XXX column

Now, i would like to use my lookup table, which contains a list of values (cs_host) for example,
and run a search on my proxy logs for all records that are within the cs_host field in the lookup table. Its kinda like a reverse lookup using the lookup tables. any tips?

Much Appreciated

Tags (1)

bregan84
Engager

Hey thanks Ayn,
is it
sourcetype=xxx [inputlookup lookup.csv | fields cs_host]
or
sourcetype=xxx [| inputlookup lookup.csv | fields cs_host]

with the extra | before inputlookup?

0 Karma

Ayn
Legend

It's as easy as this:

sourcetype=xxx [inputlookup lookup.csv | fields cs_host]

The subsearch will expand into a filter list containing all values for cs_host in your lookup.

Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...