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!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...