<?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: spath - extracting data from groups within JSON in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/spath-extracting-data-from-groups-within-JSON/m-p/690454#M235158</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/79189"&gt;@deepakc&lt;/a&gt;&amp;nbsp; - This works - thank you!&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jun 2024 11:25:53 GMT</pubDate>
    <dc:creator>Mick_OBrien</dc:creator>
    <dc:date>2024-06-12T11:25:53Z</dc:date>
    <item>
      <title>spath - extracting data from groups within JSON</title>
      <link>https://community.splunk.com/t5/Splunk-Search/spath-extracting-data-from-groups-within-JSON/m-p/690339#M235136</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;Hopefully someone can help with this.&amp;nbsp; &amp;nbsp;We have logs that contain JSON where one of the &lt;FONT color="#FF0000"&gt;fields&lt;/FONT&gt; can have multiple groups/entries - I would like to unwind/expand the groups to have a separate output per line.&amp;nbsp; I think I have to use mvzip command but I'm having issues with syntax.&amp;nbsp; Example data/query below...&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| makeresults format=json Data="[
{
\"event\": \"AGREEMENT_ACTION_COMPLETED\",
\"participantUserEmail\": \"123456789@test.com\",
\"agreement\": {
\"id\": \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\",
\"status\": \"OUT_FOR_SIGNATURE\",
\"participantSetsInfo\": {
\"participantSets\": [
{
\"memberInfos\": [
{
\"id\": \"abcdefg\",
\"email\": \"abcdefg@test.com\",
\"company\": null,
\"name\": \"test o'test\",
\"privateMessage\": null,
\"status\": \"ACTIVE\"
}
],
\"order\": \"1\",
\"role\": \"SIGNER\",
\"status\": \"WAITING_FOR_OTHERS\",
\"id\": \"abcdefg1234\",
\"name\": null,
\"privateMessage\": null
},
{
\"memberInfos\": [
{
\"id\": \"hijklmno\",
\"email\": \"hijklmno@test.com\",
\"company\": null,
\"name\": null,
\"privateMessage\": null,
\"status\": \"ACTIVE\"
}
],
\"order\": \"1\",
\"role\": \"SIGNER\",
\"status\": \"WAITING_FOR_MY_SIGNATURE\",
\"id\": \"hijklmno1234\",
\"name\": null,
\"privateMessage\": null
}
]
},
\"documentsInfo\": null,
\"agreementViewRequest\": null
}
}]"
| spath output=eventType path=event
| spath output=agreementId path=agreement.id
| spath output=agreementStatus path=agreement.status
| spath output=participantUserEmail path=participantUserEmail
| rename participantSets{}.membersInfos{}.email as memberEmail, participantSets{}.status as memberStatus
| table _time, agreementId, eventType, agreementStatus, participantUserEmail, memberEmail, memberStatus

&lt;/LI-CODE&gt;
&lt;P&gt;I still see only one line output and the 'memberEmail' and 'memberStatus' fields are showing as blank where as I want to see one line out to match every entry under&amp;nbsp;'&lt;FONT color="#FF0000"&gt;participantSets&lt;/FONT&gt;' field.&lt;/P&gt;
&lt;P&gt;Any help appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 16:37:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/spath-extracting-data-from-groups-within-JSON/m-p/690339#M235136</guid>
      <dc:creator>Mick_OBrien</dc:creator>
      <dc:date>2024-06-11T16:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: spath - extracting data from groups within JSON</title>
      <link>https://community.splunk.com/t5/Splunk-Search/spath-extracting-data-from-groups-within-JSON/m-p/690446#M235156</link>
      <description>&lt;P&gt;Replace with this and see if that gives you the results.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| spath output=eventType path=event
| spath output=agreementId path=agreement.id
| spath output=agreementStatus path=agreement.status
| spath output=participantUserEmail path=participantUserEmail
| spath output=participantSets path=agreement.participantSetsInfo.participantSets{}
| mvexpand participantSets
| spath input=participantSets output=memberInfos path=memberInfos{}
| mvexpand memberInfos
| spath input=memberInfos path=email output=memberEmail
| spath input=memberInfos path=status output=memberStatus
| table _time, agreementId, eventType, agreementStatus, participantUserEmail, memberEmail, memberStatus&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 10:51:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/spath-extracting-data-from-groups-within-JSON/m-p/690446#M235156</guid>
      <dc:creator>deepakc</dc:creator>
      <dc:date>2024-06-12T10:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: spath - extracting data from groups within JSON</title>
      <link>https://community.splunk.com/t5/Splunk-Search/spath-extracting-data-from-groups-within-JSON/m-p/690454#M235158</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/79189"&gt;@deepakc&lt;/a&gt;&amp;nbsp; - This works - thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 11:25:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/spath-extracting-data-from-groups-within-JSON/m-p/690454#M235158</guid>
      <dc:creator>Mick_OBrien</dc:creator>
      <dc:date>2024-06-12T11:25:53Z</dc:date>
    </item>
  </channel>
</rss>

