<?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: Extracting information nested in a JSON-like format in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extracting-information-nested-in-a-JSON-like-format/m-p/555054#M157537</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/224374"&gt;@husse_wl&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have single JSON data then you can try this.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval _raw="
{\"etype\":\"MaliciousUrl\",
\"aii\":\"90224859-1bce-4d99-a94c-08d92a7c3325\",
\"eid\":\"http://someURL.com/uiEWUIWER8\",
\"tid\":\"672rerce-0ccd-4867-8090-e8bb889999ae0\",
\"ts\":\"2021-06-09T02:50:41.0000000Z\",
\"te\":\"2021-06-09T02:50:41.0000000Z\",
\"trc\":\"xxxx@yyyy.com\",
\"tdc\":\"1\",
\"at\":\"2021-06-09T02:50:41.0000000Z\",
\"dm\":\"Office ATP Safe Links\",
\"ot\":\"Not Applicable\",
\"od\":\"Not Applicable\",
\"md\":\"2021-06-08T12:52:04.3356492Z\",
\"lon\":\"MaliciousUrlClick\"}" | spath | table etype&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have arrays of JSON data then use this.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval _raw="[{\"etype\": \"MaliciousUrl\",\"aii\": \"90224859-1bce-4d99-a94c-08d92a7c3325\",\"eid\": \"http://someURL.com/uiEWUIWER8\",\"tid\": \"672rerce-0ccd-4867-8090-e8bb889999ae0\",\"ts\": \"2021-06-09T02:50:41.0000000Z\",\"te\": \"2021-06-09T02:50:41.0000000Z\",\"trc\": \"xxxx@yyyy.com\",\"tdc\": \"1\",\"at\": \"2021-06-09T02:50:41.0000000Z\",\"dm\": \"Office ATP Safe Links\",\"ot\": \"Not Applicable\",\"od\": \"Not Applicable\",\"md\": \"2021-06-08T12:52:04.3356492Z\",\"lon\": \"MaliciousUrlClick\"},{\"etype\": \"MaliciousUrl\",\"aii\": \"90224859-1bce-4d99-a94c-08d92a7c3325\",\"eid\": \"http://someURL.com/uiEWUIWER8\",\"tid\": \"672rerce-0ccd-4867-8090-e8bb889999ae0\",\"ts\": \"2021-06-09T02:50:41.0000000Z\",\"te\": \"2021-06-09T02:50:41.0000000Z\",\"trc\": \"xxxx@yyyy.com\",\"tdc\": \"1\",\"at\": \"2021-06-09T02:50:41.0000000Z\",\"dm\": \"Office ATP Safe Links\",\"ot\": \"Not Applicable\",\"od\": \"Not Applicable\",\"md\": \"2021-06-08T12:52:04.3356492Z\",\"lon\": \"MaliciousUrlClick\"}]" | spath path={} output=data | mvexpand data | rename data as _raw | spath | table etype&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In case you have different type of data then share samples with us along with expected output.&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;KV&lt;BR /&gt;▄︻̷̿┻̿═━一&lt;BR /&gt;&lt;BR /&gt;If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.&lt;/P&gt;</description>
    <pubDate>Wed, 09 Jun 2021 09:41:03 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2021-06-09T09:41:03Z</dc:date>
    <item>
      <title>Extracting information nested in a JSON-like format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-information-nested-in-a-JSON-like-format/m-p/555042#M157533</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I'm designing some searches from O365 logs that have a complicated field called "Data", depending on the workload. I have 2 cases about this.&lt;BR /&gt;&lt;BR /&gt;In the first case,&amp;nbsp; with the Workload of SecurityCompliance, the field Data comes like this:&lt;BR /&gt;&lt;BR /&gt;{"etype":"MaliciousUrl",&lt;BR /&gt;"aii":"90224859-1bce-4d99-a94c-08d92a7c3325",&lt;BR /&gt;"eid":"&lt;A href="http://someURL.com/uiEWUIWER8" target="_blank" rel="noopener"&gt;http://someURL.com/uiEWUIWER8&lt;/A&gt;",&lt;BR /&gt;"tid":"672rerce-0ccd-4867-8090-e8bb889999ae0",&lt;BR /&gt;"ts":"2021-06-09T02:50:41.0000000Z",&lt;BR /&gt;"te":"2021-06-09T02:50:41.0000000Z",&lt;BR /&gt;"trc":"xxxx@yyyy.com",&lt;BR /&gt;"tdc":"1",&lt;BR /&gt;"at":"2021-06-09T02:50:41.0000000Z",&lt;BR /&gt;"dm":"Office ATP Safe Links",&lt;BR /&gt;"ot":"Not Applicable",&lt;BR /&gt;"od":"Not Applicable",&lt;BR /&gt;"md":"2021-06-08T12:52:04.3356492Z",&lt;BR /&gt;"lon":"MaliciousUrlClick"}&lt;BR /&gt;&lt;BR /&gt;And what I've tried for extracting the field "etype", for example, is:&lt;BR /&gt;&lt;BR /&gt;MY SEARCH | spath Data output=Data | table Data.etype&lt;BR /&gt;MY SEARCH | spath Data&amp;nbsp; | table Data{}.etype&lt;BR /&gt;MY SEARCH | spath | table Data.etype&lt;BR /&gt;&lt;BR /&gt;And that kind of things... Didn't work&lt;BR /&gt;&lt;BR /&gt;And in the 2nd case, with the Workload=AirInvestigation. I have kind of the same data structure but with lots of lines, like 190 lines (impossible to copy here without messing it up), and with array fields, grouping items with [ ]&amp;nbsp; instead of { }&amp;nbsp; and that kind of things.&lt;BR /&gt;&lt;BR /&gt;If you could help me, I would thank you so much.&lt;BR /&gt;&lt;BR /&gt;Thanks for your assistance and have a nice day.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jun 2021 08:22:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-information-nested-in-a-JSON-like-format/m-p/555042#M157533</guid>
      <dc:creator>husse_wl</dc:creator>
      <dc:date>2021-06-09T08:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting information nested in a JSON-like format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-information-nested-in-a-JSON-like-format/m-p/555054#M157537</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/224374"&gt;@husse_wl&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have single JSON data then you can try this.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval _raw="
{\"etype\":\"MaliciousUrl\",
\"aii\":\"90224859-1bce-4d99-a94c-08d92a7c3325\",
\"eid\":\"http://someURL.com/uiEWUIWER8\",
\"tid\":\"672rerce-0ccd-4867-8090-e8bb889999ae0\",
\"ts\":\"2021-06-09T02:50:41.0000000Z\",
\"te\":\"2021-06-09T02:50:41.0000000Z\",
\"trc\":\"xxxx@yyyy.com\",
\"tdc\":\"1\",
\"at\":\"2021-06-09T02:50:41.0000000Z\",
\"dm\":\"Office ATP Safe Links\",
\"ot\":\"Not Applicable\",
\"od\":\"Not Applicable\",
\"md\":\"2021-06-08T12:52:04.3356492Z\",
\"lon\":\"MaliciousUrlClick\"}" | spath | table etype&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have arrays of JSON data then use this.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval _raw="[{\"etype\": \"MaliciousUrl\",\"aii\": \"90224859-1bce-4d99-a94c-08d92a7c3325\",\"eid\": \"http://someURL.com/uiEWUIWER8\",\"tid\": \"672rerce-0ccd-4867-8090-e8bb889999ae0\",\"ts\": \"2021-06-09T02:50:41.0000000Z\",\"te\": \"2021-06-09T02:50:41.0000000Z\",\"trc\": \"xxxx@yyyy.com\",\"tdc\": \"1\",\"at\": \"2021-06-09T02:50:41.0000000Z\",\"dm\": \"Office ATP Safe Links\",\"ot\": \"Not Applicable\",\"od\": \"Not Applicable\",\"md\": \"2021-06-08T12:52:04.3356492Z\",\"lon\": \"MaliciousUrlClick\"},{\"etype\": \"MaliciousUrl\",\"aii\": \"90224859-1bce-4d99-a94c-08d92a7c3325\",\"eid\": \"http://someURL.com/uiEWUIWER8\",\"tid\": \"672rerce-0ccd-4867-8090-e8bb889999ae0\",\"ts\": \"2021-06-09T02:50:41.0000000Z\",\"te\": \"2021-06-09T02:50:41.0000000Z\",\"trc\": \"xxxx@yyyy.com\",\"tdc\": \"1\",\"at\": \"2021-06-09T02:50:41.0000000Z\",\"dm\": \"Office ATP Safe Links\",\"ot\": \"Not Applicable\",\"od\": \"Not Applicable\",\"md\": \"2021-06-08T12:52:04.3356492Z\",\"lon\": \"MaliciousUrlClick\"}]" | spath path={} output=data | mvexpand data | rename data as _raw | spath | table etype&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In case you have different type of data then share samples with us along with expected output.&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;KV&lt;BR /&gt;▄︻̷̿┻̿═━一&lt;BR /&gt;&lt;BR /&gt;If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jun 2021 09:41:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-information-nested-in-a-JSON-like-format/m-p/555054#M157537</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-06-09T09:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting information nested in a JSON-like format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-information-nested-in-a-JSON-like-format/m-p/555087#M157551</link>
      <description>&lt;P&gt;Hi Kamlesh, thank you for your answer.&lt;BR /&gt;&lt;BR /&gt;The problem is that the field values can change so establishing a variable with every values is non-viable.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jun 2021 13:10:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-information-nested-in-a-JSON-like-format/m-p/555087#M157551</guid>
      <dc:creator>husse_wl</dc:creator>
      <dc:date>2021-06-09T13:10:37Z</dc:date>
    </item>
  </channel>
</rss>

