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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...