<?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 convert multivalue fields with corresponding value in another field to column-value pair? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-multivalue-fields-with-corresponding-value-in/m-p/315305#M94399</link>
    <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults count=3
| streamstats count AS serial
| eval ExtendedProperties.Name="DisplayName IsPublic Mail"
| makemv ExtendedProperties.Name
| eval ExtendedProperties.Value=case(
   (serial=1), "Test Group::False::testgroup@microsoft.com",
   (serial=2), "Group1::True::group1@microsoft.com",
   (serial=3), "Group2::True::group2@microsoft.com")
| makemv delim="::" ExtendedProperties.Value
| fields - _time

| rename COMMENT AS "Everything above is faking your data; everyting below is your solution"

| eval KVP=mvzip('ExtendedProperties.Name', 'ExtendedProperties.Value', "=")
| table KVP serial
| mvexpand KVP
| rex field=KVP "^(?&amp;lt;KVP_key&amp;gt;[^=]+)=(?&amp;lt;KVP_value&amp;gt;[^=]+)$"
| eval {KVP_key}=KVP_value
| fields - KVP* 
| stats values(*) AS * BY serial
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 07 Apr 2017 15:37:23 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2017-04-07T15:37:23Z</dc:date>
    <item>
      <title>How to convert multivalue fields with corresponding value in another field to column-value pair?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-multivalue-fields-with-corresponding-value-in/m-p/315302#M94396</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;We have recently configured the Splunk Add-on for Microsoft Cloud Services to pull o365 logs into Splunk. For the most part the field extractions are good, except for the extractions when a new OneDrive/Office 365 group is added. When a new group is added following is the part raw event i have can see in Splunk from the JSON pull&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ExtendedProperties:    [   [-] 
    {   [-] 
     Name:   DisplayName    
     Value:  [] =&amp;gt; [Test Group];    
    }   
    {   [-] 
     Name:   IsPublic   
     Value:  [] =&amp;gt; [False];     
    }   
    {   [-] 
     Name:   Mail   
     Value:  [] =&amp;gt; [testgroup@microsoft.com];   
    }   
    {   [-] 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The field extraction in Splunk show up as field - ExtendedProperties.Name and has values: DisplayName, IsPublic Mail    and &lt;BR /&gt;
field - ExtendedProperties.Value and has values:  [] =&amp;gt; [Test Group];  [] =&amp;gt; [False]; [] =&amp;gt; [&lt;A href="mailto:testgroup@microsoft.com"&gt;testgroup@microsoft.com&lt;/A&gt;];.&lt;/P&gt;

&lt;P&gt;I managed to use the eval{ExtendedProperties.Name}=ExtendedProperties.Value  and when displayed in a table format the results appeared as the following all in one event.&lt;BR /&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/2729i3B895BA16359EB5D/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;However, i want to display the data in the following format, any ideas how to do this? &lt;BR /&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/2730iA8E39B9A1FB2A203/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 00:03:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-multivalue-fields-with-corresponding-value-in/m-p/315302#M94396</guid>
      <dc:creator>lindbergh_calde</dc:creator>
      <dc:date>2017-04-07T00:03:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert multivalue fields with corresponding value in another field to column-value pair?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-multivalue-fields-with-corresponding-value-in/m-p/315303#M94397</link>
      <description>&lt;P&gt;Use &lt;CODE&gt;mvzip&lt;/CODE&gt; to bind the pairs of values together and then use your &lt;CODE&gt;eval {field_key_name} = field_value_name&lt;/CODE&gt; trick after doing &lt;CODE&gt;mvexpand&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 03:29:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-multivalue-fields-with-corresponding-value-in/m-p/315303#M94397</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-04-07T03:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert multivalue fields with corresponding value in another field to column-value pair?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-multivalue-fields-with-corresponding-value-in/m-p/315304#M94398</link>
      <description>&lt;P&gt;Hi Greg,&lt;/P&gt;

&lt;P&gt;Thanks for you response.&lt;/P&gt;

&lt;P&gt;This is the search i ran&lt;/P&gt;

&lt;P&gt;index=o365 Operation="Add group." | eval names='ExtendedProperties{}.Name', vals='ExtendedProperties{}.Value' | eval temp=mvzip(names,vals) | eval {names}=vals | mvexpand temp&lt;/P&gt;

&lt;P&gt;can't seem to get the output i want it. Should i modify this search somehow?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 04:06:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-multivalue-fields-with-corresponding-value-in/m-p/315304#M94398</guid>
      <dc:creator>lindbergh_calde</dc:creator>
      <dc:date>2017-04-07T04:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert multivalue fields with corresponding value in another field to column-value pair?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-multivalue-fields-with-corresponding-value-in/m-p/315305#M94399</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults count=3
| streamstats count AS serial
| eval ExtendedProperties.Name="DisplayName IsPublic Mail"
| makemv ExtendedProperties.Name
| eval ExtendedProperties.Value=case(
   (serial=1), "Test Group::False::testgroup@microsoft.com",
   (serial=2), "Group1::True::group1@microsoft.com",
   (serial=3), "Group2::True::group2@microsoft.com")
| makemv delim="::" ExtendedProperties.Value
| fields - _time

| rename COMMENT AS "Everything above is faking your data; everyting below is your solution"

| eval KVP=mvzip('ExtendedProperties.Name', 'ExtendedProperties.Value', "=")
| table KVP serial
| mvexpand KVP
| rex field=KVP "^(?&amp;lt;KVP_key&amp;gt;[^=]+)=(?&amp;lt;KVP_value&amp;gt;[^=]+)$"
| eval {KVP_key}=KVP_value
| fields - KVP* 
| stats values(*) AS * BY serial
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Apr 2017 15:37:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-multivalue-fields-with-corresponding-value-in/m-p/315305#M94399</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-04-07T15:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert multivalue fields with corresponding value in another field to column-value pair?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-multivalue-fields-with-corresponding-value-in/m-p/315306#M94400</link>
      <description>&lt;P&gt;See other answer.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 15:37:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-multivalue-fields-with-corresponding-value-in/m-p/315306#M94400</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-04-07T15:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert multivalue fields with corresponding value in another field to column-value pair?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-multivalue-fields-with-corresponding-value-in/m-p/315307#M94401</link>
      <description>&lt;P&gt;Thanks Greg&lt;/P&gt;

&lt;P&gt;That worked brilliantly. &lt;/P&gt;</description>
      <pubDate>Sun, 09 Apr 2017 22:58:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-multivalue-fields-with-corresponding-value-in/m-p/315307#M94401</guid>
      <dc:creator>lindbergh_calde</dc:creator>
      <dc:date>2017-04-09T22:58:44Z</dc:date>
    </item>
  </channel>
</rss>

