Splunk Search

How to incorporate a lookup in search but with wild card?

intrach
Explorer

Hello all,

I have a lookup table which contains a list of URL we want to search in splunk, but instead of searching the specific URL in the list, we want to search when it contains a string in that URL.

example:

in the lookup we have a URL:
blog.example.com

I also want it to search and find URL which contains "blog.example.com". In the search it should be url=*blog.example.com, but how can I apply this search characteristic when using a lookup.

 

Thanks for any help.

Labels (1)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @intrach,

which error are you receiving?

anyway, did you creted the lookup definition for your lookup?

are your sure about the "url" fieldname (it's case sensitive)?

the search seems to be correct:

index=dns_file [ | inputlookup Sus_url.csv | rename url AS query | fields query ]

Ciao.

Giuseppe

View solution in original post

intrach
Explorer

Thanks2x...it was the url field name being Url...thanks so much..you're a legend!

0 Karma

intrach
Explorer

Hi Giuseppe,

 

Sorry, i am relatively new at this. So my lookup file name is Sus_url.csv and I have a column name of url in the lookup which contains the list.

so I input:
index=dns_file
[ |inputlookup Sus_url.csv | rename url AS query | fields query ]
| ...

 

but it is giving me an error 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

What error is it giving?

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @intrach,

which error are you receiving?

anyway, did you creted the lookup definition for your lookup?

are your sure about the "url" fieldname (it's case sensitive)?

the search seems to be correct:

index=dns_file [ | inputlookup Sus_url.csv | rename url AS query | fields query ]

Ciao.

Giuseppe

gcusello
SplunkTrust
SplunkTrust

Hi @intrach,

could you please try something like this?

index=your_index [ | inputlookup | rename url AS query | fields query ]
| ...

in this way you perform a free text search using the content of the lookup's url field.

Ciao.

Giuseppe

0 Karma
Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

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