<?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 form key, value pairs from 2 multivalue fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-form-key-value-pairs-from-2-multivalue-fields/m-p/446754#M126709</link>
    <description>&lt;P&gt;Hi @ramki1459 try this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval time=10000 | eval field1="x:y:z" 
 | eval field2="10:20:30" 
 | makemv delim=":" field1
 | makemv delim=":" field2
 | eval F2andF3=mvzip(field1,field2)
 | mvexpand F2andF3
 | rex field=F2andF3 "^(?&amp;lt;field1&amp;gt;[^,]+),(?&amp;lt;field2&amp;gt;.*)$"
 | table time field1 field2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 07 Jun 2018 10:53:59 GMT</pubDate>
    <dc:creator>harishalipaka</dc:creator>
    <dc:date>2018-06-07T10:53:59Z</dc:date>
    <item>
      <title>How to form key, value pairs from 2 multivalue fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-form-key-value-pairs-from-2-multivalue-fields/m-p/446753#M126708</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;
I am trying to extract data from 2 multivalue fields and trying to form key value pair, for example, I have data something like below&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time,    field1 ,     field2
10000,  x:y:z         10:20:30
10001,  a:b:c         40:50:60
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to extract data something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;10000, x 10
10000, y 20
10000, z 30
10001, a 40
10001, b 50
10001, c 60
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I tried with makemv but not able to get the result in above format. any input is really appreciated. Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jun 2018 21:30:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-form-key-value-pairs-from-2-multivalue-fields/m-p/446753#M126708</guid>
      <dc:creator>ramki1459</dc:creator>
      <dc:date>2018-06-05T21:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to form key, value pairs from 2 multivalue fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-form-key-value-pairs-from-2-multivalue-fields/m-p/446754#M126709</link>
      <description>&lt;P&gt;Hi @ramki1459 try this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval time=10000 | eval field1="x:y:z" 
 | eval field2="10:20:30" 
 | makemv delim=":" field1
 | makemv delim=":" field2
 | eval F2andF3=mvzip(field1,field2)
 | mvexpand F2andF3
 | rex field=F2andF3 "^(?&amp;lt;field1&amp;gt;[^,]+),(?&amp;lt;field2&amp;gt;.*)$"
 | table time field1 field2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Jun 2018 10:53:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-form-key-value-pairs-from-2-multivalue-fields/m-p/446754#M126709</guid>
      <dc:creator>harishalipaka</dc:creator>
      <dc:date>2018-06-07T10:53:59Z</dc:date>
    </item>
  </channel>
</rss>

