Splunk Search

lookup table using like syntax

rdownie
Communicator

If I have a lookup table that contains the following:


mstring,category
%-mdfa,network
%-mdfb,network
%cam,camera
%-avaya,phone

and I want to match it using a like syntax (SQL or where hostname like mstring) where I could have b01k-mdfa return network for category. Is there a way to do this with a lookup?

Tags (2)
0 Karma
1 Solution

Ayn
Legend

Not using % as wildcard, but *. When you define your lookup table in transforms.conf, you can specify a MATCH_TYPE. Set this to WILDCARD and you will be able to lookup values using a table similar to yours. Something like

mstring,category
*-mdfa,network
...

http://docs.splunk.com/Documentation/Splunk/latest/admin/Transformsconf

View solution in original post

Ayn
Legend

Not using % as wildcard, but *. When you define your lookup table in transforms.conf, you can specify a MATCH_TYPE. Set this to WILDCARD and you will be able to lookup values using a table similar to yours. Something like

mstring,category
*-mdfa,network
...

http://docs.splunk.com/Documentation/Splunk/latest/admin/Transformsconf

rdownie
Communicator

Thanks, worked like a charm!!!!

0 Karma
Get Updates on the Splunk Community!

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...