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!

.conf25 Community Recap

Hello Splunkers, And just like that, .conf25 is in the books! What an incredible few days — full of learning, ...

Splunk App Developers | .conf25 Recap & What’s Next

If you stopped by the Builder Bar at .conf25 this year, thank you! The retro tech beer garden vibes were ...

Congratulations to the 2025-2026 SplunkTrust!

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