<?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 split multiple values in a column and make into row in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-multiple-values-in-a-column-and-make-into-row/m-p/307034#M92082</link>
    <description>&lt;P&gt;Updated -  the &lt;CODE&gt;mvzip/mvexpand/rex&lt;/CODE&gt; combination is unnecessary art.  Use &lt;CODE&gt;mvrange/mvexpand/eval&lt;/CODE&gt;, especially if there are more than two fields to be correlated.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval mydata="1,Null0,0 1,TenGig/0,273 1,TenGig/1,511 2,Null0,0 2,TenGig/0,277 2,TenGig/1,512" 
| makemv mydata 
| mvexpand mydata 
| makemv delim="," mydata
| eval _time=now()+tonumber(mvindex(mydata,0)) | eval interface=mvindex(mydata,1) | eval bytes=mvindex(mydata,2)
| table _time interface bytes
| stats list(interface) as interface_name list(bytes) as bytes_received by _time
| rename COMMENT as "The above just generates some test data"

| eval myFan=mvrange(0,mvcount(interface_name))    
| mvexpand myFan
| eval interface_name =mvindex(interface_name,myFan)
| eval  bytes_received =mvindex(bytes_received,myFan)
| table _time interface_name bytes_received
| eval {interface_name} = bytes_received
| fields - interface_name bytes_received
| stats values(*) as * by _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;P&gt;Here's another way...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval mydata="1,Null0,0 1,TenGig/0,273 1,TenGig/1,511 2,Null0,0 2,TenGig/0,277 2,TenGig/1,512" 
| makemv mydata | mvexpand mydata | makemv delim="," mydata
| eval _time=now()+tonumber(mvindex(mydata,0)) | eval interface=mvindex(mydata,1) | eval bytes=mvindex(mydata,2)
| table _time interface bytes
| stats list(interface) as interface_name list(bytes) as bytes_received by _time
| rename COMMENT as "The above just generates some test data"

| eval mystuff=mvzip(interface_name,bytes_received,"=")
| table _time mystuff
| mvexpand mystuff
| rex field=mystuff "^(?&amp;lt;interface_name&amp;gt;[^=]+)=(?&amp;lt;bytes_received&amp;gt;.*)"
| table _time interface_name bytes_received
| eval {interface_name} = bytes_received
| fields - interface_name bytes_received
| stats values(*) as * by _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 22 May 2017 17:18:57 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2017-05-22T17:18:57Z</dc:date>
    <item>
      <title>How to split multiple values in a column and make into row</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-multiple-values-in-a-column-and-make-into-row/m-p/307032#M92080</link>
      <description>&lt;P&gt;I have the following search result which has multiple values in a cell:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2977i9FDD4453AD1D8074/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I would like to format the result into the following:&lt;/P&gt;

&lt;P&gt;_time               Null0                          TenGig0          TenGig39 ...&lt;BR /&gt;
            &amp;lt;273276296&amp;gt;   &amp;lt;277830477&amp;gt;...&lt;BR /&gt;
        &amp;lt;0&amp;gt;                               &amp;lt;273256478&amp;gt;    &amp;lt;277810817&amp;gt;...&lt;BR /&gt;
Is there a way to do this? I have tried "transpose" which messed up the values. &lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2017 16:40:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-multiple-values-in-a-column-and-make-into-row/m-p/307032#M92080</guid>
      <dc:creator>jgcsco</dc:creator>
      <dc:date>2017-05-22T16:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to split multiple values in a column and make into row</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-multiple-values-in-a-column-and-make-into-row/m-p/307033#M92081</link>
      <description>&lt;P&gt;Hello, &lt;/P&gt;

&lt;P&gt;Try something like this, &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search.. ... | eval temp=mvzip(interface_name,bytes_received,"###") | mvexpand temp | rex field=temp "(?&amp;lt;interface_name&amp;gt;.*)###(?&amp;lt;bytes_received&amp;gt;.*)" | fields - temp | xyseries _time, interface_name,bytes_received
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Description:&lt;/P&gt;

&lt;P&gt;Use interface_name,bytes_received fields and make a single field  called temp by using mvzip. use mvexpand to populate the actual values, extract the fields using rex. use xyseries to populate the values. &lt;/P&gt;

&lt;P&gt;Make sure the 2 field names are correct (interface_name,bytes_received )&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:10:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-multiple-values-in-a-column-and-make-into-row/m-p/307033#M92081</guid>
      <dc:creator>vasanthmss</dc:creator>
      <dc:date>2020-09-29T14:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to split multiple values in a column and make into row</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-multiple-values-in-a-column-and-make-into-row/m-p/307034#M92082</link>
      <description>&lt;P&gt;Updated -  the &lt;CODE&gt;mvzip/mvexpand/rex&lt;/CODE&gt; combination is unnecessary art.  Use &lt;CODE&gt;mvrange/mvexpand/eval&lt;/CODE&gt;, especially if there are more than two fields to be correlated.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval mydata="1,Null0,0 1,TenGig/0,273 1,TenGig/1,511 2,Null0,0 2,TenGig/0,277 2,TenGig/1,512" 
| makemv mydata 
| mvexpand mydata 
| makemv delim="," mydata
| eval _time=now()+tonumber(mvindex(mydata,0)) | eval interface=mvindex(mydata,1) | eval bytes=mvindex(mydata,2)
| table _time interface bytes
| stats list(interface) as interface_name list(bytes) as bytes_received by _time
| rename COMMENT as "The above just generates some test data"

| eval myFan=mvrange(0,mvcount(interface_name))    
| mvexpand myFan
| eval interface_name =mvindex(interface_name,myFan)
| eval  bytes_received =mvindex(bytes_received,myFan)
| table _time interface_name bytes_received
| eval {interface_name} = bytes_received
| fields - interface_name bytes_received
| stats values(*) as * by _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;P&gt;Here's another way...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval mydata="1,Null0,0 1,TenGig/0,273 1,TenGig/1,511 2,Null0,0 2,TenGig/0,277 2,TenGig/1,512" 
| makemv mydata | mvexpand mydata | makemv delim="," mydata
| eval _time=now()+tonumber(mvindex(mydata,0)) | eval interface=mvindex(mydata,1) | eval bytes=mvindex(mydata,2)
| table _time interface bytes
| stats list(interface) as interface_name list(bytes) as bytes_received by _time
| rename COMMENT as "The above just generates some test data"

| eval mystuff=mvzip(interface_name,bytes_received,"=")
| table _time mystuff
| mvexpand mystuff
| rex field=mystuff "^(?&amp;lt;interface_name&amp;gt;[^=]+)=(?&amp;lt;bytes_received&amp;gt;.*)"
| table _time interface_name bytes_received
| eval {interface_name} = bytes_received
| fields - interface_name bytes_received
| stats values(*) as * by _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 May 2017 17:18:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-multiple-values-in-a-column-and-make-into-row/m-p/307034#M92082</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-05-22T17:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to split multiple values in a column and make into row</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-multiple-values-in-a-column-and-make-into-row/m-p/307035#M92083</link>
      <description>&lt;P&gt;Thank you so much for your quick response and solution. Works just like what I am looking for. &lt;/P&gt;

&lt;P&gt;By the way, do you have any great idea to calculate the incremental of bytes_received between each sampling time? Right now, the number is accumulative. &lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2017 17:19:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-multiple-values-in-a-column-and-make-into-row/m-p/307035#M92083</guid>
      <dc:creator>jgcsco</dc:creator>
      <dc:date>2017-05-22T17:19:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to split multiple values in a column and make into row</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-multiple-values-in-a-column-and-make-into-row/m-p/307036#M92084</link>
      <description>&lt;P&gt;Thanks for the detailed steps, vasanthmss's  option is more simple and straight forward. &lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2017 00:21:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-multiple-values-in-a-column-and-make-into-row/m-p/307036#M92084</guid>
      <dc:creator>jgcsco</dc:creator>
      <dc:date>2017-05-23T00:21:47Z</dc:date>
    </item>
  </channel>
</rss>

