Splunk Search

How to extract multivalue field values without using the mvexpand command?

lpolo
Motivator

I would like to extract the key=value pairs found in a multivalue field, but without doing mvexpand mvfield.

Note: the multivalue field is created with the split command.

For instance result set after split command:

|eval mvfield=split(mvfield,"&")

Result:

timestamp mvfield=(k1=v1, k2=v2, k3=v3...,kn=vn) 

desired result set without using mvexpand:

 timestamp (k1=v1, k2=v2, k3=v3,...,kn=vn

Thanks,
Lp

0 Karma
1 Solution

sundareshr
Legend

Have you looked at extract? Try this

base search | extract pairdelim="&" kvdelim="=" | ...

View solution in original post

sundareshr
Legend

Have you looked at extract? Try this

base search | extract pairdelim="&" kvdelim="=" | ...

lpolo
Motivator

Yeah. I forgot about the extract command. It does the trick.

thanks,
Lp

0 Karma

sundareshr
Legend

Please accept the answer to close it out.

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...