<?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: Json match `field.name` to `field.value` fields in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Json-match-field-name-to-field-value-fields/m-p/263658#M50601</link>
    <description>&lt;P&gt;It's a bit odd, but I found splitting the values apart and putting them back together works:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; eval names='ExtendedProperties{}.Name', vals='ExtendedProperties{}.Value' | eval temp=mvzip(names,vals) | mvexpand temp | rex field=temp "(?&amp;lt;name&amp;gt;[^,]+),(?&amp;lt;val&amp;gt;[^,]+)" | eval {name}=val | transaction Id
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;P&gt;updated to add back the deleted terms in angle brackets. - dmj&lt;/P&gt;</description>
    <pubDate>Fri, 27 Jan 2017 05:51:25 GMT</pubDate>
    <dc:creator>jschroth</dc:creator>
    <dc:date>2017-01-27T05:51:25Z</dc:date>
    <item>
      <title>Json match `field.name` to `field.value` fields</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Json-match-field-name-to-field-value-fields/m-p/263652#M50595</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;I have some office 365 json events that have an &lt;CODE&gt;ExtendedProperties&lt;/CODE&gt; array field containing multiple json objects, as in the example below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{ "ExtendedProperties" : [
        {   "Name" : Role.ObjectId ,
            "Value" : xxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx5e10
        },
        {
            "Name" : Role.RoleTemplateId ,
            "Value" : xxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx5e10
        },
        {   "Name" : Role.DisplayName,
            "Value" : Company Administrator
        },
        {   "Name" : Role.WellKnownObject,
            "Value" : TenantAdmins
        }
    ]
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am interested in filtering finding &lt;CODE&gt;Value&lt;/CODE&gt; where &lt;CODE&gt;Name=Role.DisplayName&lt;/CODE&gt;. It would all be a lot easier if there were a way to create new fields where &lt;CODE&gt;Role.DisplayName = "Company Administrator"&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2016 12:51:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Json-match-field-name-to-field-value-fields/m-p/263652#M50595</guid>
      <dc:creator>oerd_rbal</dc:creator>
      <dc:date>2016-10-18T12:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: Json match `field.name` to `field.value` fields</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Json-match-field-name-to-field-value-fields/m-p/263653#M50596</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.... | eval {Name}=Value | search "Role.DisplayName"="Company Administrator"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Oct 2016 13:11:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Json-match-field-name-to-field-value-fields/m-p/263653#M50596</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-10-18T13:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: Json match `field.name` to `field.value` fields</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Json-match-field-name-to-field-value-fields/m-p/263654#M50597</link>
      <description>&lt;P&gt;@sundareshr &lt;CODE&gt;Name&lt;/CODE&gt; is actually contained in &lt;CODE&gt;ExtendedProperties&lt;/CODE&gt; and &lt;CODE&gt;| eval {ExtendedProperties.Name}=ExtendedProperties.Value ...&lt;/CODE&gt; doesn't create an &lt;CODE&gt;Role.DisplayName&lt;/CODE&gt; field.&lt;BR /&gt;
Is there a way to do this with &lt;CODE&gt;foreach&lt;/CODE&gt;?&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2016 13:51:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Json-match-field-name-to-field-value-fields/m-p/263654#M50597</guid>
      <dc:creator>oerd_rbal</dc:creator>
      <dc:date>2016-10-18T13:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: Json match `field.name` to `field.value` fields</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Json-match-field-name-to-field-value-fields/m-p/263655#M50598</link>
      <description>&lt;P&gt;Try enclosing fieldnames within single-quotes. &lt;CODE&gt;| eval {'ExtendedProperties.Name'}='ExtendedProperties.Value' | ...&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2016 14:08:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Json-match-field-name-to-field-value-fields/m-p/263655#M50598</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-10-18T14:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: Json match `field.name` to `field.value` fields</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Json-match-field-name-to-field-value-fields/m-p/263656#M50599</link>
      <description>&lt;P&gt;@oerd_rbal - Did you ever get this to work? I'm working with almost an identical JSON structure. Nothing on this page has worked for me to automatically extract the fields.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2016 19:09:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Json-match-field-name-to-field-value-fields/m-p/263656#M50599</guid>
      <dc:creator>mattlorimor</dc:creator>
      <dc:date>2016-11-10T19:09:32Z</dc:date>
    </item>
    <item>
      <title>Re: Json match `field.name` to `field.value` fields</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Json-match-field-name-to-field-value-fields/m-p/263657#M50600</link>
      <description>&lt;P&gt;@mattlorimor No, I gave up altogether and changed my approach to the much less elegant one of extracting fields based on regexes... &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2016 13:05:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Json-match-field-name-to-field-value-fields/m-p/263657#M50600</guid>
      <dc:creator>oerd_rbal</dc:creator>
      <dc:date>2016-11-11T13:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: Json match `field.name` to `field.value` fields</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Json-match-field-name-to-field-value-fields/m-p/263658#M50601</link>
      <description>&lt;P&gt;It's a bit odd, but I found splitting the values apart and putting them back together works:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; eval names='ExtendedProperties{}.Name', vals='ExtendedProperties{}.Value' | eval temp=mvzip(names,vals) | mvexpand temp | rex field=temp "(?&amp;lt;name&amp;gt;[^,]+),(?&amp;lt;val&amp;gt;[^,]+)" | eval {name}=val | transaction Id
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;P&gt;updated to add back the deleted terms in angle brackets. - dmj&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 05:51:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Json-match-field-name-to-field-value-fields/m-p/263658#M50601</guid>
      <dc:creator>jschroth</dc:creator>
      <dc:date>2017-01-27T05:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: Json match `field.name` to `field.value` fields</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Json-match-field-name-to-field-value-fields/m-p/263659#M50602</link>
      <description>&lt;P&gt;I find it safer to use four or five exclamation points "!!!!" as my delimiter for mvzip, rather than a comma, since it almost never appears in my data and commas often do.&lt;/P&gt;

&lt;P&gt;Your code would look something like this -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  eval names='ExtendedProperties{}.Name', vals='ExtendedProperties{}.Value' | eval temp=mvzip(names,vals,"!!!!") | mvexpand temp | rex field=temp "(?&amp;lt;name&amp;gt;..*?)!!!!(?&amp;lt;val&amp;gt;.*)" | eval {name}=val | transaction Id
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;By the way, you have to mark your code as code before the first time you submit it, or the angle-brackets get deleted by the web interface.  I've put the field names back into the regex.&lt;/P&gt;</description>
      <pubDate>Sat, 28 Jan 2017 00:39:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Json-match-field-name-to-field-value-fields/m-p/263659#M50602</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-01-28T00:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: Json match `field.name` to `field.value` fields</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Json-match-field-name-to-field-value-fields/m-p/263660#M50603</link>
      <description>&lt;P&gt;Thanks, man! Such a pity the angular brackets were removed by code formatting...&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2017 16:10:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Json-match-field-name-to-field-value-fields/m-p/263660#M50603</guid>
      <dc:creator>oerd_rbal</dc:creator>
      <dc:date>2017-02-21T16:10:40Z</dc:date>
    </item>
  </channel>
</rss>

