Splunk Search

use wildcard in lookup

katalinali
Path Finder

I have a lookup table like:

input output

========================================

KH00IS23 ABC

. . .

KH00IS98 ABC

ER97IT00 ZXC

. . .

ER97IT45 ZXC

ER97IT55_1432 ZXC03

. . .

ER97IT55_4988 ZXC03

ER97IT60_3421 UYT

. . .

ER97IT60_8764 UYT

I have several thousand of inputs but it just matches to about fifty output and the overhead of extracting all the fields is very high. I would like to ask if splunk can support wildcard or regex in lookup to the performance. By the way, is there default lookup like case i.e. if all value in a field is not match any record, then it should match to the default value.

Tags (1)
0 Karma

dvb
Path Finder

There actually is the possibility of using wildcards in lookups. See answer 28566

tawollen
Path Finder

Here is something else that might work.

  • | lookup mytable.csv input | eval output if(isnull(output),"default value", output)

This looks up a field in the lookup, if the field is not there, then it will put output as "default value"

0 Karma

ziegfried
Influencer

No, Splunk doesn't support wildcards or regular expressions in lookups. But you can specify a default value if none of the lookup values matches. You can do so by specifing min_matches=1 and default_match=TEXT either in the stanza in transforms.conf or in the manager in the Advanced Options of the lookup.

gkanapathy
Splunk Employee
Splunk Employee

This answer was correct, but is out of date as of version 4.2

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!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...