<?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: Nested JSON field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Nested-JSON-field/m-p/402958#M172937</link>
    <description>&lt;P&gt;You can try using spath to parse it first. Then pull out the fields.&lt;/P&gt;

&lt;P&gt;| makeresults&lt;BR /&gt;&lt;BR /&gt;
| eval raw="{ \"computer\": { \"extension_attributes\": [ { \"id\": 1, \"name\": \"xxx-enrolled\", \"type\": \"String\", \"value\": \"3\" }, { \"id\": 7, \"name\": \"xxx-filevault\", \"type\": \"String\", \"value\": \"FileVault is On.\" }, { \"id\": 4, \"name\": \"xxx-initial-hostname\", \"type\": \"String\", \"value\": \"xxxx-2i3l\" }, { \"id\": 5, \"name\": \"Host name\", \"type\": \"String\", \"value\": \"xxxx-2i3l\" }, { \"id\": 2, \"name\": \"Last User\", \"type\": \"String\", \"value\": \"\" }, { \"id\": 5, \"name\": \"xxx-enrolled\", \"type\": \"String\", \"value\": \"10\" }, ] } }"&lt;BR /&gt;
| rename raw AS _raw &lt;BR /&gt;
| spath&lt;BR /&gt;&lt;BR /&gt;
| rename computer.extension_attributes{}.name AS name &lt;BR /&gt;
| stats count by name&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 23:23:39 GMT</pubDate>
    <dc:creator>jason_prondak</dc:creator>
    <dc:date>2020-09-29T23:23:39Z</dc:date>
    <item>
      <title>Nested JSON field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Nested-JSON-field/m-p/402957#M172936</link>
      <description>&lt;P&gt;Hi I'm trying to do a count within my JSON logs. It's about the following data. I want to do a count for the extension_attribute with the name xxx-enrolled base on the value. How can I parse through this data? stats count is what I'm after.&lt;/P&gt;

&lt;P&gt;{&lt;BR /&gt;
  "computer": {&lt;BR /&gt;
    "extension_attributes": [&lt;BR /&gt;
      {&lt;BR /&gt;
        "id": 1,&lt;BR /&gt;
        "name": "xxx-enrolled",&lt;BR /&gt;
        "type": "String",&lt;BR /&gt;
        "value": "3"&lt;BR /&gt;
      },&lt;BR /&gt;
      {&lt;BR /&gt;
        "id": 7,&lt;BR /&gt;
        "name": "xxx-filevault",&lt;BR /&gt;
        "type": "String",&lt;BR /&gt;
        "value": "FileVault is On."&lt;BR /&gt;
      },&lt;BR /&gt;
      {&lt;BR /&gt;
        "id": 4,&lt;BR /&gt;
        "name": "xxx-initial-hostname",&lt;BR /&gt;
        "type": "String",&lt;BR /&gt;
        "value": "xxxx-2i3l"&lt;BR /&gt;
      },&lt;BR /&gt;
      {&lt;BR /&gt;
        "id": 5,&lt;BR /&gt;
        "name": "Host name",&lt;BR /&gt;
        "type": "String",&lt;BR /&gt;
        "value": "xxxx-2i3l"&lt;BR /&gt;
      },&lt;BR /&gt;
      {&lt;BR /&gt;
        "id": 2,&lt;BR /&gt;
        "name": "Last User",&lt;BR /&gt;
        "type": "String",&lt;BR /&gt;
        "value": ""&lt;BR /&gt;
      },&lt;BR /&gt;
    ]&lt;BR /&gt;
  }&lt;BR /&gt;
}&lt;/P&gt;</description>
      <pubDate>Wed, 20 Feb 2019 11:20:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Nested-JSON-field/m-p/402957#M172936</guid>
      <dc:creator>melvincorneliss</dc:creator>
      <dc:date>2019-02-20T11:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: Nested JSON field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Nested-JSON-field/m-p/402958#M172937</link>
      <description>&lt;P&gt;You can try using spath to parse it first. Then pull out the fields.&lt;/P&gt;

&lt;P&gt;| makeresults&lt;BR /&gt;&lt;BR /&gt;
| eval raw="{ \"computer\": { \"extension_attributes\": [ { \"id\": 1, \"name\": \"xxx-enrolled\", \"type\": \"String\", \"value\": \"3\" }, { \"id\": 7, \"name\": \"xxx-filevault\", \"type\": \"String\", \"value\": \"FileVault is On.\" }, { \"id\": 4, \"name\": \"xxx-initial-hostname\", \"type\": \"String\", \"value\": \"xxxx-2i3l\" }, { \"id\": 5, \"name\": \"Host name\", \"type\": \"String\", \"value\": \"xxxx-2i3l\" }, { \"id\": 2, \"name\": \"Last User\", \"type\": \"String\", \"value\": \"\" }, { \"id\": 5, \"name\": \"xxx-enrolled\", \"type\": \"String\", \"value\": \"10\" }, ] } }"&lt;BR /&gt;
| rename raw AS _raw &lt;BR /&gt;
| spath&lt;BR /&gt;&lt;BR /&gt;
| rename computer.extension_attributes{}.name AS name &lt;BR /&gt;
| stats count by name&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:23:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Nested-JSON-field/m-p/402958#M172937</guid>
      <dc:creator>jason_prondak</dc:creator>
      <dc:date>2020-09-29T23:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: Nested JSON field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Nested-JSON-field/m-p/402959#M172938</link>
      <description>&lt;P&gt;What should the exact output be?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Feb 2019 05:54:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Nested-JSON-field/m-p/402959#M172938</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-02-21T05:54:56Z</dc:date>
    </item>
  </channel>
</rss>

