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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...