<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to expand multiple multivalue fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-expand-multiple-multivalue-fields/m-p/160150#M45245</link>
    <description>&lt;P&gt;Are they all the same cardinality?&lt;/P&gt;</description>
    <pubDate>Thu, 20 Feb 2014 20:55:36 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2014-02-20T20:55:36Z</dc:date>
    <item>
      <title>How to expand multiple multivalue fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-expand-multiple-multivalue-fields/m-p/160146#M45241</link>
      <description>&lt;P&gt;My table is a mess. There are 2 single-value fields and 6 multivalue fields. The multivalue fields can have any number of multiple values. One of the multivalue fields runs a simple eval comparing two of the other multivalue fields.&lt;/P&gt;

&lt;P&gt;The problem is this. While the table is organized with each event neatly displaying multiple lines (within one table row), I can't seem to find a way to break out each line into its own row. This makes it difficult later to do any analysis, and it breaks the eval.&lt;/P&gt;

&lt;P&gt;Instead of:&lt;/P&gt;

&lt;P&gt;mv1a mv2a  sv1&lt;/P&gt;

&lt;P&gt;mv1b mv2b&lt;/P&gt;

&lt;P&gt;mv1c mv3b&lt;/P&gt;

&lt;P&gt;as a single row, I'd rather see&lt;/P&gt;

&lt;P&gt;mv1a mv2a sv1&lt;/P&gt;

&lt;P&gt;mv1b mv2b sv1&lt;/P&gt;

&lt;P&gt;mv1c mv2c sv1&lt;/P&gt;

&lt;P&gt;where each line is a separate row. If I mvexpand everything, it turns into a giant heavily duplicated mess.&lt;/P&gt;

&lt;P&gt;Does anyone know a neat solution for this?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2014 20:07:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-expand-multiple-multivalue-fields/m-p/160146#M45241</guid>
      <dc:creator>willial</dc:creator>
      <dc:date>2014-02-20T20:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to expand multiple multivalue fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-expand-multiple-multivalue-fields/m-p/160147#M45242</link>
      <description>&lt;P&gt;If you have two multi-value fields of the same cardinality N and want to expand each event into N rows you can zip them together, expand, un-zip roughly like so:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval zipped = mvzip(mv1, mv2, "###") | mvexpand zipped | eval mv1 = replace(zipped, "###.*$", "") | eval mv2 = replace(zipped, "^.*###", "") | fields - zipped
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm not quite sure if that matches your problem because you have an mv3b in your "before" example rather than an mv2c.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2014 20:22:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-expand-multiple-multivalue-fields/m-p/160147#M45242</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-02-20T20:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to expand multiple multivalue fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-expand-multiple-multivalue-fields/m-p/160148#M45243</link>
      <description>&lt;P&gt;mv3b was a typo. I'll give this a shot and see what happens.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2014 20:27:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-expand-multiple-multivalue-fields/m-p/160148#M45243</guid>
      <dc:creator>willial</dc:creator>
      <dc:date>2014-02-20T20:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to expand multiple multivalue fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-expand-multiple-multivalue-fields/m-p/160149#M45244</link>
      <description>&lt;P&gt;This doesn't seem to expand to work with the 6 multivalue fields I actually have.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2014 20:48:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-expand-multiple-multivalue-fields/m-p/160149#M45244</guid>
      <dc:creator>willial</dc:creator>
      <dc:date>2014-02-20T20:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to expand multiple multivalue fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-expand-multiple-multivalue-fields/m-p/160150#M45245</link>
      <description>&lt;P&gt;Are they all the same cardinality?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2014 20:55:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-expand-multiple-multivalue-fields/m-p/160150#M45245</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-02-20T20:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to expand multiple multivalue fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-expand-multiple-multivalue-fields/m-p/160151#M45246</link>
      <description>&lt;P&gt;Within a single event row, all the multivalue fields are the same cardinality. Between rows they can vary (ie, mv1 might have 3 entries in the first event and 10 entries in the second event).&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2014 20:59:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-expand-multiple-multivalue-fields/m-p/160151#M45246</guid>
      <dc:creator>willial</dc:creator>
      <dc:date>2014-02-20T20:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to expand multiple multivalue fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-expand-multiple-multivalue-fields/m-p/160152#M45247</link>
      <description>&lt;P&gt;Inspired by @martin&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search ..| eval zip=mvzip(mvfield1,mvfield2,"##") | eval zip=mvzip(zip,mvfield3,"##") | eval zip=mvzip(zip,mvfield4,"##")| eval zip=mvzip(zip,mvfield5,"##")| eval zip=mvzip(zip,mvfield6,"##") | mvexpand zip | rex field=zip "(?&amp;lt;mvfield1&amp;gt;.*)##(?&amp;lt;mvfield2&amp;gt;.*)##(?&amp;lt;mvfield3&amp;gt;.*)##(?&amp;lt;mvfield4&amp;gt;.*)##(?&amp;lt;mvfield5&amp;gt;.*)##(?&amp;lt;mvfield6&amp;gt;.*)" | fields - zip
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Feb 2014 21:08:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-expand-multiple-multivalue-fields/m-p/160152#M45247</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-02-20T21:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to expand multiple multivalue fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-expand-multiple-multivalue-fields/m-p/160153#M45248</link>
      <description>&lt;P&gt;I would load a picture but I'm a little new and it won't let me.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2014 21:08:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-expand-multiple-multivalue-fields/m-p/160153#M45248</guid>
      <dc:creator>willial</dc:creator>
      <dc:date>2014-02-20T21:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to expand multiple multivalue fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-expand-multiple-multivalue-fields/m-p/160154#M45249</link>
      <description>&lt;P&gt;Okay, same within a row is enough. Here's how I'd expand my example to three fields:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval zipped = mvzip(mv1, mv2, "###") | eval zipped = mvzip(zipped, mv3, "###") | mvexpand zipped | makemv delim="###" zipped | eval mv1 = mvindex(zipped, 0) | eval mv2 = mvindex(zipped, 1) | eval mv3 = mvindex(zipped, 2) | fields - zipped
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should expand to six fields in the same way... using makemv to split the zipped field apart appears easier for many fields than replace.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2014 21:12:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-expand-multiple-multivalue-fields/m-p/160154#M45249</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-02-20T21:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to expand multiple multivalue fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-expand-multiple-multivalue-fields/m-p/160155#M45250</link>
      <description>&lt;P&gt;It works with same cardinality N for all the fields. Suppose if mvfield2 contains some null values then it will not properly. In my case there is a single column contains multivalued fields. how to expand this into multiple rows.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Nov 2014 18:57:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-expand-multiple-multivalue-fields/m-p/160155#M45250</guid>
      <dc:creator>srinathd</dc:creator>
      <dc:date>2014-11-11T18:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to expand multiple multivalue fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-expand-multiple-multivalue-fields/m-p/160156#M45251</link>
      <description>&lt;P&gt;@somesoni2&lt;/P&gt;

&lt;P&gt;Hi Somesh,&lt;/P&gt;

&lt;P&gt;How to split this .&lt;BR /&gt;
my query:&lt;/P&gt;

&lt;P&gt;transaction part| timechart values(duration) as duration,values(rollno) as rollno&lt;/P&gt;

&lt;P&gt;_time                                          duration                                    rollno&lt;BR /&gt;
2016-08-07 21:13:00              10.07                                           1&lt;BR /&gt;
                                                   9.56                                             2&lt;BR /&gt;
                                                   7.35                                             3&lt;BR /&gt;
                                                   12.32                                           4&lt;/P&gt;

&lt;P&gt;I need output in below format:&lt;BR /&gt;
_time                                          duration                                 rollno&lt;BR /&gt;
2016-08-07 21:13:00                 10.07                                        1&lt;BR /&gt;
2016-08-07 21:13:00                 9.56                                          2&lt;BR /&gt;
2016-08-07 21:13:00                 7.35                                          3&lt;BR /&gt;
2016-08-07 21:13:00                 12.32                                        4&lt;/P&gt;

&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2016 21:16:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-expand-multiple-multivalue-fields/m-p/160156#M45251</guid>
      <dc:creator>sridharreddy</dc:creator>
      <dc:date>2016-08-08T21:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to expand multiple multivalue fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-expand-multiple-multivalue-fields/m-p/160157#M45252</link>
      <description>&lt;P&gt;This is both beautiful and terrible at the same time.&lt;BR /&gt;
I love it.&lt;/P&gt;

&lt;P&gt;I also like this better than the replace method. It scales a bit better, and regex is awesome.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 00:28:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-expand-multiple-multivalue-fields/m-p/160157#M45252</guid>
      <dc:creator>mew1033</dc:creator>
      <dc:date>2017-01-13T00:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to expand multiple multivalue fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-expand-multiple-multivalue-fields/m-p/160158#M45253</link>
      <description>&lt;P&gt;@martin_mueller &lt;BR /&gt;
Thanks. I've working with Splunk for almost 2 years and have never encountered multi-value. Your solution above worked on my first try.&lt;BR /&gt;
Thanks and God bless,&lt;BR /&gt;
Genesius&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 16:18:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-expand-multiple-multivalue-fields/m-p/160158#M45253</guid>
      <dc:creator>genesiusj</dc:creator>
      <dc:date>2020-02-26T16:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to expand multiple multivalue fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-expand-multiple-multivalue-fields/m-p/545853#M154711</link>
      <description>&lt;P&gt;I wished I knew zip command earlier ! Just beautiful answer !&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 12:50:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-expand-multiple-multivalue-fields/m-p/545853#M154711</guid>
      <dc:creator>ivan_yanev</dc:creator>
      <dc:date>2021-03-29T12:50:23Z</dc:date>
    </item>
  </channel>
</rss>

