Getting Data In

How do I use lookup to filter results? Need search to contain (not equal) a value

mschellhouse
Path Finder

I am looking to filter events in splunk by values in a lookup table. I implemented the solution from this question, and it is partial working:
https://answers.splunk.com/answers/110381/use-lookup-to-filter-events.html

The change that I need to make is to have my lookup values be used in a "contains" filter as apposed to a literal/equal filter.

my sample code:
-search string-
[| inputlookup searchtermsample2.csv
| fields query]
| stats count by searchTerms

So... how do I rewrite so that there are wildcards on each side of the lookup field?

0 Karma

pradeepkumarg
Influencer

Below should do

-search string- [| inputlookup searchtermsample2.csv | fields query | eval query="\*".query."\*" | table query | format] 
Get Updates on the Splunk Community!

A Guide To Cloud Migration Success

As enterprises’ rapid expansion to the cloud continues, IT leaders are continuously looking for ways to focus ...

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...