Splunk Search

Issue of lookup csv file and output multiple values

leo_wang
Path Finder

Hi,

When I lookup a csv file, and match multiple values, it will output as a multi-value fields .
Like that :
alt text

But, if that possible to expand the result as multiple records instead of multi-value record.
( like the result of "join" command does)
What I want will look like that :
alt text

I known there is a "mvexpand" command, but this command only accept only 1 fields to expand the record.
And because my lookup file is very large and it is the time-based lookup, so it is difficult to change the "join" command instead the "lookup".

Any idea?

0 Karma
1 Solution

mayurr98
Super Champion

well you are certainly looking to expand multiple fields then you would need to do mvzip and then mvexpand
have a look at this doc for mvzip
http://docs.splunk.com/Documentation/Splunk/7.0.3/SearchReference/MultivalueEvalFunctions#mvzip.28X....

for example, if you have 4 fields then try

| eval a=mvzip(field1,mvzip(field2,mvzip(field3,field4))) | mvexpand a | then use regex to seperate it out

let me know if this helps!

View solution in original post

0 Karma

mayurr98
Super Champion

well you are certainly looking to expand multiple fields then you would need to do mvzip and then mvexpand
have a look at this doc for mvzip
http://docs.splunk.com/Documentation/Splunk/7.0.3/SearchReference/MultivalueEvalFunctions#mvzip.28X....

for example, if you have 4 fields then try

| eval a=mvzip(field1,mvzip(field2,mvzip(field3,field4))) | mvexpand a | then use regex to seperate it out

let me know if this helps!

0 Karma

leo_wang
Path Finder

Thanks for your idea.
It sound workable, but I am worried about the performance because there will be huge volume of data to process.

But it still worth a try~

0 Karma

landen99
Motivator

performance should not be an issue here

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

 Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...

Introduction to Splunk AI

How are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. Lucky for ...