Splunk Search

How to extract key/value parameters and issue lookup?

vhwang
New Member

I have a log containing some commands like so:

SWFCMD_DNLK_LOG:  WHICHLOG = CMD_LOG_IMDCMD, TIMERANGESTRT = 0, TIMERANGEEND = 2147483647, DNLNKPRIO = 1
IHFVIS_FW_ABS:  FILTER_NUM = FILTER_4

Or in a more familiar syntax:
swfcmd_dnlk_log(whichlog=cmd_log_imdcmd, timerangestrt=0, timerangeend=20123, dnlinkprio=1)

I have another lookup table that looks like this:

function_name, function_description, parameter, parameter_description
swfcmd_dnlk_log  dnlk_description_txt  whichlog   whichlog_description_text
swfcmd_dnlk_log  dnlk_description_txt  timerangestrt timerangestrt_description_text
etc...

What's the best way to perform the extraction and lookup?

Tags (2)
0 Karma

woodcock
Esteemed Legend

Let Splunk do the KVP extraction automatically like this in props.conf:

KV_MODE=auto_escaped

Then do the lookup like this

... lookup MYLOOKUP WHICHLOG AS parameter  OUTPUT parameter_description

Or this:

... lookup MYLOOKUP WHICHLOG AS function_name OUTPUT function_description
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!

SOC4Kafka - New Kafka Connector Powered by OpenTelemetry

The new SOC4Kafka connector, built on OpenTelemetry, enables the collection of Kafka messages and forwards ...

Event Series: Level up your SOC: Advancing with Splunk Enterprise Security

AI has fundamentally raised the stakes for security operations, and this three-part series is your guide to ...

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 ...