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!

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...

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

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...