<?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: Multiple JSON Objects in same event in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462248#M130299</link>
    <description>&lt;P&gt;Correct, actionType will only appear once. For some reason, the searchmatch is only returning the number of events.&lt;/P&gt;</description>
    <pubDate>Mon, 10 Feb 2020 17:37:08 GMT</pubDate>
    <dc:creator>mrlandis3</dc:creator>
    <dc:date>2020-02-10T17:37:08Z</dc:date>
    <item>
      <title>Multiple JSON Objects in same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462236#M130287</link>
      <description>&lt;P&gt;The data I am receiving sends multiple JSON objects that have the same keys within them. &lt;/P&gt;

&lt;P&gt;EDIT: I've added a sample log. This is a single event that i need to count each DELETE_RETIRED_DEVICE, so 3 in this case. There are no commas between the JSON objects, they are 3 separate objects.&lt;/P&gt;

&lt;P&gt;{"connectedCloudName":"","logType":"userAction","version":1,"loggedAt":1580947200024,"actionAt":1580947200024,"device":{"uuid":"","phoneNumber":"","platform":"Android 8.0"},"actor":{"miUserId":9062,"principal":"","email":"-"},"configuration":null,"updatedBlob":null,"certificateDetails":null,"message":null,"spaceName":"Global","spacePath":"/1/","actionType":"DELETE_RETIRED_DEVICE","requestedAt":1580947200024,"completedAt":1580947200024,"reason":"Deleted the retired device successfully","status":"Success","objectId":null,"objectType":null,"objectName":null,"subjectId":"","subjectType":"Smartphone","subjectName":" (Android 8.0 - 12406901520)","subjectOwnerName":null,"requesterName":"misystem","updateRequestId":null,"userInRole":null,"parentId":null,"cookie":null}&lt;BR /&gt;
{"connectedCloudName":"","logType":"userAction","version":1,"loggedAt":1580947200292,"actionAt":1580947200292,"device":null,"actor":null,"configuration":null,"updatedBlob":null,"certificateDetails":null,"message":null,"spaceName":null,"spacePath":null,"actionType":"SYSTEM_CONFIG_CHANGE","requestedAt":1580947200292,"completedAt":1580947200292,"reason":"Modify Preference lastDeleteRetiredDevicesStatus from Successful, 2020-02-05 00:00:00 UTC to Successful, 2020-02-06 00:00:00 UTC","status":"Success","objectId":null,"objectType":null,"objectName":null,"subjectId":null,"subjectType":"Settings Preferences","subjectName":"System","subjectOwnerName":null,"requesterName":"misystem","updateRequestId":null,"userInRole":null,"parentId":null,"cookie":null}&lt;BR /&gt;
{"connectedCloudName":"","logType":"userAction","version":1,"loggedAt":1580947200292,"actionAt":1580947200292,"device":null,"actor":null,"configuration":null,"updatedBlob":null,"certificateDetails":null,"message":null,"spaceName":null,"spacePath":null,"actionType":"DELETE_RETIRED_DEVICE","requestedAt":1580947200292,"completedAt":1580947200292,"reason":"Initiated retired device count = 2, deleted retired device count = 2","status":"Success","objectId":null,"objectType":null,"objectName":null,"subjectId":null,"subjectType":null,"subjectName":"misystem (Source - DailyJob, Bulk deletion - 2)","subjectOwnerName":null,"requesterName":"misystem","updateRequestId":null,"userInRole":null,"parentId":null,"cookie":null}&lt;BR /&gt;
{"connectedCloudName":"","logType":"userAction","version":1,"loggedAt":1580947200011,"actionAt":1580947200011,"device":null,"actor":null,"configuration":null,"updatedBlob":null,"certificateDetails":null,"message":null,"spaceName":null,"spacePath":null,"actionType":"DELETE_RETIRED_DEVICE","requestedAt":1580947200011,"completedAt":1580947200011,"reason":"Initiating bulk deletion of 2 retired device(s)","status":"Initiated","objectId":null,"objectType":null,"objectName":null,"subjectId":null,"subjectType":null,"subjectName":"misystem (Source - DailyJob, Bulk deletion - 2)","subjectOwnerName":null,"requesterName":"misystem","updateRequestId":null,"userInRole":null,"parentId":null,"cookie":null}&lt;/P&gt;

&lt;P&gt;Below is the abbreviated objects:&lt;BR /&gt;
{actionType ... other keys/values}&lt;BR /&gt;
{actionType ... other keys/values}&lt;BR /&gt;
{actionType ... other keys/values}&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:02:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462236#M130287</guid>
      <dc:creator>mrlandis3</dc:creator>
      <dc:date>2020-09-30T04:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple JSON Objects in same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462237#M130288</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Check this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="{\"nameList\":
[{\"name\" : \"Apple\"},
{\"name\" : \"Orange\"},
{\"name\" : \"Orange\"},
{\"name\" : \"Graphs\"},
{\"name\" : \"Apple\"},
{\"name\" : \"Apple\"}]}" 
| append 
    [| makeresults 
    | eval _raw="{\"nameList\":
[{\"name\" : \"Apple\"}]}"] 
| spath path=nameList{}.name output=name 
| stats count by name 
| where name="Apple"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Feb 2020 16:26:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462237#M130288</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2020-02-05T16:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple JSON Objects in same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462238#M130289</link>
      <description>&lt;P&gt;In your example, you provided a JSON object that had an array of keys. That is not the case for me. I will have multiple JSON objects in a single event. So the event looks like how I posted in my question.&lt;BR /&gt;
Event 1:&lt;BR /&gt;
{object 1 keys/values}&lt;BR /&gt;
{object 2 keys/values}&lt;/P&gt;

&lt;P&gt;Event 2:&lt;BR /&gt;
{object 3 keys/values}&lt;/P&gt;

&lt;P&gt;and so on&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2020 19:02:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462238#M130289</guid>
      <dc:creator>mrlandis3</dc:creator>
      <dc:date>2020-02-05T19:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple JSON Objects in same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462239#M130290</link>
      <description>&lt;P&gt;@mrlandis3 It seems your question has been asked before a few times. The answers I looked to the most were:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/762294/parse-nested-json-array-into-splunk-table.html"&gt;https://answers.splunk.com/answers/762294/parse-nested-json-array-into-splunk-table.html&lt;/A&gt;&lt;BR /&gt;
and&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/366957/how-do-i-get-splunk-to-extract-nested-json-arrays.html"&gt;https://answers.splunk.com/answers/366957/how-do-i-get-splunk-to-extract-nested-json-arrays.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Essentially, when dealing with nested json, they both used a combination of the &lt;CODE&gt;spath&lt;/CODE&gt; &amp;amp; &lt;CODE&gt;mvexpand&lt;/CODE&gt; commands. Once you have the key value pairs isolated using those commands, then asking &lt;CODE&gt;| where key=value1 | stats count&lt;/CODE&gt; or similar, should be fine.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2020 19:39:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462239#M130290</guid>
      <dc:creator>efavreau</dc:creator>
      <dc:date>2020-02-05T19:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple JSON Objects in same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462240#M130291</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="{\"connectedCloudName\":\"\",\"logType\":\"userAction\",\"version\":1,\"loggedAt\":1580947200024,\"actionAt\":1580947200024,\"device\":{\"uuid\":\"\",\"phoneNumber\":\"\",\"platform\":\"Android 8.0\"},\"actor\":{\"miUserId\":9062,\"principal\":\"\",\"email\":\"-\"},\"configuration\":null,\"updatedBlob\":null,\"certificateDetails\":null,\"message\":null,\"spaceName\":\"Global\",\"spacePath\":\"/1/\",\"actionType\":\"DELETE_RETIRED_DEVICE\",\"requestedAt\":1580947200024,\"completedAt\":1580947200024,\"reason\":\"Deleted the retired device successfully\",\"status\":\"Success\",\"objectId\":null,\"objectType\":null,\"objectName\":null,\"subjectId\":\"\",\"subjectType\":\"Smartphone\",\"subjectName\":\" (Android 8.0 - 12406901520)\",\"subjectOwnerName\":null,\"requesterName\":\"misystem\",\"updateRequestId\":null,\"userInRole\":null,\"parentId\":null,\"cookie\":null}
{\"connectedCloudName\":\"\",\"logType\":\"userAction\",\"version\":1,\"loggedAt\":1580947200292,\"actionAt\":1580947200292,\"device\":null,\"actor\":null,\"configuration\":null,\"updatedBlob\":null,\"certificateDetails\":null,\"message\":null,\"spaceName\":null,\"spacePath\":null,\"actionType\":\"SYSTEM_CONFIG_CHANGE\",\"requestedAt\":1580947200292,\"completedAt\":1580947200292,\"reason\":\"Modify Preference lastDeleteRetiredDevicesStatus from Successful, 2020-02-05 00:00:00 UTC to Successful, 2020-02-06 00:00:00 UTC\",\"status\":\"Success\",\"objectId\":null,\"objectType\":null,\"objectName\":null,\"subjectId\":null,\"subjectType\":\"Settings Preferences\",\"subjectName\":\"System\",\"subjectOwnerName\":null,\"requesterName\":\"misystem\",\"updateRequestId\":null,\"userInRole\":null,\"parentId\":null,\"cookie\":null}
{\"connectedCloudName\":\"\",\"logType\":\"userAction\",\"version\":1,\"loggedAt\":1580947200292,\"actionAt\":1580947200292,\"device\":null,\"actor\":null,\"configuration\":null,\"updatedBlob\":null,\"certificateDetails\":null,\"message\":null,\"spaceName\":null,\"spacePath\":null,\"actionType\":\"DELETE_RETIRED_DEVICE\",\"requestedAt\":1580947200292,\"completedAt\":1580947200292,\"reason\":\"Initiated retired device count = 2, deleted retired device count = 2\",\"status\":\"Success\",\"objectId\":null,\"objectType\":null,\"objectName\":null,\"subjectId\":null,\"subjectType\":null,\"subjectName\":\"misystem (Source - DailyJob, Bulk deletion - 2)\",\"subjectOwnerName\":null,\"requesterName\":\"misystem\",\"updateRequestId\":null,\"userInRole\":null,\"parentId\":null,\"cookie\":null}
{\"connectedCloudName\":\"\",\"logType\":\"userAction\",\"version\":1,\"loggedAt\":1580947200011,\"actionAt\":1580947200011,\"device\":null,\"actor\":null,\"configuration\":null,\"updatedBlob\":null,\"certificateDetails\":null,\"message\":null,\"spaceName\":null,\"spacePath\":null,\"actionType\":\"DELETE_RETIRED_DEVICE\",\"requestedAt\":1580947200011,\"completedAt\":1580947200011,\"reason\":\"Initiating bulk deletion of 2 retired device(s)\",\"status\":\"Initiated\",\"objectId\":null,\"objectType\":null,\"objectName\":null,\"subjectId\":null,\"subjectType\":null,\"subjectName\":\"misystem (Source - DailyJob, Bulk deletion - 2)\",\"subjectOwnerName\":null,\"requesterName\":\"misystem\",\"updateRequestId\":null,\"userInRole\":null,\"parentId\":null,\"cookie\":null}"
| rename COMMENT as "this is your sample. From here, the logic"
| makemv delim="
" _raw
| stats count by _raw
| stats count(eval(searchmatch("DELETE_RETIRED_DEVICE"))) as result
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;H2&gt; If there is sample log, it is good and clear.&lt;/H2&gt;

&lt;PRE&gt;&lt;CODE&gt;your search
| makemv delim="
" _raw
| stats count by _raw
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;that's all.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2020 21:05:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462240#M130291</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-05T21:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple JSON Objects in same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462241#M130292</link>
      <description>&lt;P&gt;These do not answer my question. These help with a single JSON object that has nested objects within it in a single event. My logs have multiple JSON objects within a single event.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 12:25:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462241#M130292</guid>
      <dc:creator>mrlandis3</dc:creator>
      <dc:date>2020-02-06T12:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple JSON Objects in same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462242#M130293</link>
      <description>&lt;P&gt;Please provide a log sample so we can try things against it. Creating and guessing at a working dummy data sample, sometimes takes more time than solving for it, once we know what we're looking at.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 13:30:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462242#M130293</guid>
      <dc:creator>efavreau</dc:creator>
      <dc:date>2020-02-06T13:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple JSON Objects in same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462243#M130294</link>
      <description>&lt;P&gt;I've added the sample log, thank you&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 13:38:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462243#M130294</guid>
      <dc:creator>mrlandis3</dc:creator>
      <dc:date>2020-02-06T13:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple JSON Objects in same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462244#M130295</link>
      <description>&lt;P&gt;this doesn't count multiples of the same value within a single event&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 14:12:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462244#M130295</guid>
      <dc:creator>mrlandis3</dc:creator>
      <dc:date>2020-02-06T14:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple JSON Objects in same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462245#M130296</link>
      <description>&lt;P&gt;hi @mrlandis3&lt;BR /&gt;
thanks for providing sample. check my updated answer.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 23:23:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462245#M130296</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-06T23:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple JSON Objects in same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462246#M130297</link>
      <description>&lt;P&gt;unfortunately this does not account for where the value may appear more than once within the same log&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 15:58:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462246#M130297</guid>
      <dc:creator>mrlandis3</dc:creator>
      <dc:date>2020-02-07T15:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple JSON Objects in same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462247#M130298</link>
      <description>&lt;P&gt;@mrlandis3 &lt;BR /&gt;
First, my query split  &lt;CODE&gt;connectedCloudName&lt;/CODE&gt; object.&lt;BR /&gt;
&lt;CODE&gt;actionType&lt;/CODE&gt; in &lt;CODE&gt;connectedCloudName&lt;/CODE&gt; appears twice or more? &lt;BR /&gt;
Looking at your sample, &lt;CODE&gt;actionType&lt;/CODE&gt; in &lt;CODE&gt;connectedCloudName&lt;/CODE&gt; is only one.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 23:11:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462247#M130298</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-07T23:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple JSON Objects in same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462248#M130299</link>
      <description>&lt;P&gt;Correct, actionType will only appear once. For some reason, the searchmatch is only returning the number of events.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2020 17:37:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462248#M130299</guid>
      <dc:creator>mrlandis3</dc:creator>
      <dc:date>2020-02-10T17:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple JSON Objects in same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462249#M130300</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| rename COMMENT as "this is your sample. From here, the logic" 
| makemv delim="
 " _raw 
| stats count by _raw 
| spath 
| stats count(eval(actionType="DELETE_RETIRED_DEVICE")) as count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I don't beleave &lt;CODE&gt;searchmatch&lt;/CODE&gt; can't work. &lt;BR /&gt;
what's your query? there is strange fields extracted.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2020 20:07:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462249#M130300</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-10T20:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple JSON Objects in same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462250#M130301</link>
      <description>&lt;P&gt;This worked, thank you! There was an extra space copying it in which is why did not work initially.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 14:25:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462250#M130301</guid>
      <dc:creator>mrlandis3</dc:creator>
      <dc:date>2020-02-12T14:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple JSON Objects in same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462251#M130302</link>
      <description>&lt;P&gt;Could you explain why the first stats count by _raw is needed?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 14:31:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462251#M130302</guid>
      <dc:creator>mrlandis3</dc:creator>
      <dc:date>2020-02-12T14:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple JSON Objects in same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462252#M130303</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;|stats count by _raw ≈ mvexpand _raw
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but &lt;CODE&gt;mvexpand _raw&lt;/CODE&gt; does not work, so I use &lt;CODE&gt;stats count by _raw&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 14:59:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-JSON-Objects-in-same-event/m-p/462252#M130303</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-12T14:59:47Z</dc:date>
    </item>
  </channel>
</rss>

