Splunk Search

need help with UI based lookup wildcard/CIDR

MonkeyK
Builder

I recently noticed that the UI for lookup definitions now has an advanced checkbox. If I select that I get the option to set match_type, which is described as

Match type
Optionally set up non-exact matching of a comma-and-space-delimited field list. Format is (). Available values for match_type are WILDCARD and CIDR.

so I added a wildard match for my lookup field IP to my lookup definition for tools:

match_type=WILDCARD (IP)

(note, I tried CIDR, too, with similar results)

and in the lookup file tools.csv, I had an entry with a *

IP: 10.10.35.*
Tool: Splunk

but when try to use it, I do not get a match:

|makeresults |eval IP="10.10.35.9" | lookup tools IP

This did not return the Tool field, although if I pass it a matching string it does:

|makeresults |eval IP="10.10.35.*" | lookup tools IP

gets me back tool=Splunk

is there something that I am misunderstanding about the UI based lookup wildcard? Something else that I should be doing?

0 Karma
1 Solution

woodcock
Esteemed Legend

It should be WILDCARD(IP), not WILDCARD (IP). It should also be:

IP,Tool
Splunk,10.10.35.*

Not:

IP: 10.10.35.*
Tool: Splunk

View solution in original post

0 Karma

woodcock
Esteemed Legend

It should be WILDCARD(IP), not WILDCARD (IP). It should also be:

IP,Tool
Splunk,10.10.35.*

Not:

IP: 10.10.35.*
Tool: Splunk
0 Karma

MonkeyK
Builder

Tried
match_type=WILDCARD(IP)

with the same results. Waited an hour as well, but still same results.

sorry on the csv. I should have written that correctly. Since it was just a lookup table, the data was actually stored correctly as
IP,Tool
Splunk,10.10.35.*

Also tried
Tried
match_type=WILDCARD(IP)
and changing the lookup table to
IP,Tool
Splunk,10.10.35.0/24

with the same results --no lookup match
although
|makeresults |eval IP="10.10.35.0/24" | lookup tools IP
does return a Tool value of Splunk

0 Karma

MonkeyK
Builder

For now I cheated and re-evaluated the query IP to match the lookup.

First checks the lookup for a full IP match, and then checks for a match on the final octet "wildcarded".

|makeresults |eval IP="10.10.35.9" 
| lookup tools IP 
| eval IP3=IP 
| rex mode=sed field=IP3 "s/(?<IP3>\d{1,3}\.\d{1,3}\.\d{1,3}+\.)\d{1,3}/\1*/g" 
| lookup tools IP as IP3 OUTPUTNEW 
0 Karma

MonkeyK
Builder

OK. Learned where I went wrong on this one.

I actually entered
match_type=WILDCARD(IP)
into the UI.

I actually only needed to enter
WILDCARD(IP)

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...