Splunk Search

About warnings when dividing multiple multi-value data using mvexpand.

yutaka1005
Builder

In the following search I divide data with multiple multi-value fields into one line at a time.

See this answer ↓
https://answers.splunk.com/answers/25653/mvexpand-multiple-multi-value-fields.html

| eval reading=mvzip(multi_value_field1, multi_value_field2) | eval reading=mvzip(reading, multi_value_field3) | eval reading=mvzip(reading, multi_value_field4) | mvexpand reading | makemv reading delim="," | eval field1=mvindex(reading, 0) | eval field2=mvindex(reading, 1) | eval field3=mvindex(reading, 2) | eval field4=mvindex(reading, 3) | ...

The result is OK with this search, but somehow the warning "Field 'reading' does not exist in the data." Is displayed.
Is there a way to avoid this warning?

my splunk ver : 6.5.3

0 Karma
1 Solution

DalJeanis
Legend

Okay, assuming you have the same number of values for each multivalue field, there is a simpler method. And I'm annoyed that it's taken me six months to figure it out, all the while doing that complicated mvzip two-step.

Do this instead...

| eval myFan=mvrange(0,mvcount(field1))
| mvexpand myFan
| eval field1=mvindex(field1,myFan)
| eval field2=mvindex(field2,myFan)
| eval field3=mvindex(field3,myFan)
| eval field4=mvindex(field4,myFan)

View solution in original post

0 Karma

DalJeanis
Legend

Okay, assuming you have the same number of values for each multivalue field, there is a simpler method. And I'm annoyed that it's taken me six months to figure it out, all the while doing that complicated mvzip two-step.

Do this instead...

| eval myFan=mvrange(0,mvcount(field1))
| mvexpand myFan
| eval field1=mvindex(field1,myFan)
| eval field2=mvindex(field2,myFan)
| eval field3=mvindex(field3,myFan)
| eval field4=mvindex(field4,myFan)
0 Karma

gsrivastava
Explorer

@DalJeanis Are you assuming here that all the events have just 4 values in a multi-valued field? What if , each event has different no. of values?

0 Karma

DalJeanis
Legend

@gsrivastava - The number 4 comes from the fact that there were four fields that were mvzipped together in @yutaka1005's example. The only assumption is that each of the four fields has the same number of values... although if not, then a backstop is that field1 is the field with the MOST values.

0 Karma

gsrivastava
Explorer

Facing the same issue @yutaka1005 . Did you find any solution?

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!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...