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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...