<?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 Parsing of highly nested JSON events with arrays in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Parsing-of-highly-nested-JSON-events-with-arrays/m-p/480777#M134708</link>
    <description>&lt;P&gt;We want to parse highly nested jsons into expanded tables. We found that the following code works, given we apply the | rename &lt;EM&gt;.&lt;/EM&gt; as &lt;EM&gt;_&lt;/EM&gt;  as many times as deep the nesting is. Without replacing the "." Splunk does not make all fields and subfields available. Might there be a more generic solution?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="adm_compute_qcheck" 
| rename *.* as *_*  | rename *.* as *_* | rename *.* as *_*  | rename *.* as *_* 
| rename *_{}* as ** | rename *{}_* as **  | rename *{}_* as ** 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here the first part of the JSON:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[
                  {
                      "BIOS":  {
                                   "manufacturer":  "INSYDE Corp.",
                                   "SystemBiosMajorVersion":  0,
                                   "SystemBiosMinorVersion":  41,
                                   "SMBIOSBIOSVersion":  "0.99"
                               }
                  },
                  {
                      "Checkpoint":  {

                                     }
                  },
                  {
                      "ClusterName":  null
                  },
                  {
                      "CPUType":  {
                                      "NumberOfCores":  16
                                  }
                  },
                  {
                      "HBA":  [
                                  {
                                      "active":  true,
                                      "drivername":  "elxfc",
                                      "driverversion":  "12.2.207.0",
                                      "firmwareversion":  "11.4.204.25",
                                      "optionromversion":  "11.4.204.25",
                                      "manufacturer":  "Emulex Corporation",
                                      "model":  "LPe32002-AP",
                                      "serialnumber":  "FC83980875"
                                  },
                                  {
                                      "active":  true,
                                      "drivername":  "elxfc",
                                      "driverversion":  "12.2.207.0",
                                      "firmwareversion":  "11.4.204.25",
                                      "optionromversion":  "11.4.204.25",
                                      "manufacturer":  "Emulex Corporation",
                                      "model":  "LPe32002-AP",
                                      "serialnumber":  "FC83980875"
                                  }
                              ]
                  },
                  {
                      "HPE":  [

                              ]
                  },
                  {
                      "HPEDiskCount":  0
                  },
                  {
                      "HPELogicalDisks":  {
                                              "Status":  null,
                                              "RaidLevel":  null,
                                              "ID":  null,
                                              "Capacity":  null
                                          }
                  },
                  {
                      "HPEPhysicalDisks":  [

                                           ]
                  },
                  {
                      "Mig":  {
                                  "VirtualMachineMigrationEnabled":  true,
                                  "VirtualMachineMigrationPerformanceOption":  2,
                                  "VirtualMachineMigrationAuthenticationType":  1,
                                  "MaximumVirtualMachineMigrations":  2,
                                  "MaximumStorageMigrations":  2
                              }
                  },
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 20 Apr 2020 09:29:38 GMT</pubDate>
    <dc:creator>wfskmoney</dc:creator>
    <dc:date>2020-04-20T09:29:38Z</dc:date>
    <item>
      <title>Parsing of highly nested JSON events with arrays</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Parsing-of-highly-nested-JSON-events-with-arrays/m-p/480777#M134708</link>
      <description>&lt;P&gt;We want to parse highly nested jsons into expanded tables. We found that the following code works, given we apply the | rename &lt;EM&gt;.&lt;/EM&gt; as &lt;EM&gt;_&lt;/EM&gt;  as many times as deep the nesting is. Without replacing the "." Splunk does not make all fields and subfields available. Might there be a more generic solution?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="adm_compute_qcheck" 
| rename *.* as *_*  | rename *.* as *_* | rename *.* as *_*  | rename *.* as *_* 
| rename *_{}* as ** | rename *{}_* as **  | rename *{}_* as ** 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here the first part of the JSON:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[
                  {
                      "BIOS":  {
                                   "manufacturer":  "INSYDE Corp.",
                                   "SystemBiosMajorVersion":  0,
                                   "SystemBiosMinorVersion":  41,
                                   "SMBIOSBIOSVersion":  "0.99"
                               }
                  },
                  {
                      "Checkpoint":  {

                                     }
                  },
                  {
                      "ClusterName":  null
                  },
                  {
                      "CPUType":  {
                                      "NumberOfCores":  16
                                  }
                  },
                  {
                      "HBA":  [
                                  {
                                      "active":  true,
                                      "drivername":  "elxfc",
                                      "driverversion":  "12.2.207.0",
                                      "firmwareversion":  "11.4.204.25",
                                      "optionromversion":  "11.4.204.25",
                                      "manufacturer":  "Emulex Corporation",
                                      "model":  "LPe32002-AP",
                                      "serialnumber":  "FC83980875"
                                  },
                                  {
                                      "active":  true,
                                      "drivername":  "elxfc",
                                      "driverversion":  "12.2.207.0",
                                      "firmwareversion":  "11.4.204.25",
                                      "optionromversion":  "11.4.204.25",
                                      "manufacturer":  "Emulex Corporation",
                                      "model":  "LPe32002-AP",
                                      "serialnumber":  "FC83980875"
                                  }
                              ]
                  },
                  {
                      "HPE":  [

                              ]
                  },
                  {
                      "HPEDiskCount":  0
                  },
                  {
                      "HPELogicalDisks":  {
                                              "Status":  null,
                                              "RaidLevel":  null,
                                              "ID":  null,
                                              "Capacity":  null
                                          }
                  },
                  {
                      "HPEPhysicalDisks":  [

                                           ]
                  },
                  {
                      "Mig":  {
                                  "VirtualMachineMigrationEnabled":  true,
                                  "VirtualMachineMigrationPerformanceOption":  2,
                                  "VirtualMachineMigrationAuthenticationType":  1,
                                  "MaximumVirtualMachineMigrations":  2,
                                  "MaximumStorageMigrations":  2
                              }
                  },
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Apr 2020 09:29:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Parsing-of-highly-nested-JSON-events-with-arrays/m-p/480777#M134708</guid>
      <dc:creator>wfskmoney</dc:creator>
      <dc:date>2020-04-20T09:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing of highly nested JSON events with arrays</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Parsing-of-highly-nested-JSON-events-with-arrays/m-p/480778#M134709</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Running spath against the JSON block you included here seems to extract everything:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval myJSON = "
 [
                   {
                       \"BIOS\":  {
                                    \"manufacturer\":  \"INSYDE Corp.\",
                                    \"SystemBiosMajorVersion\":  0,
                                    \"SystemBiosMinorVersion\":  41,
                                    \"SMBIOSBIOSVersion\":  \"0.99\"
                                }
                   },
                   {
                       \"Checkpoint\":  {

                                      }
                   },
                   {
                       \"ClusterName\":  null
                   },
                   {
                       \"CPUType\":  {
                                       \"NumberOfCores\":  16
                                   }
                   },
                   {
                       \"HBA\":  [
                                   {
                                       \"active\":  true,
                                       \"drivername\":  \"elxfc\",
                                       \"driverversion\":  \"12.2.207.0\",
                                       \"firmwareversion\":  \"11.4.204.25\",
                                       \"optionromversion\":  \"11.4.204.25\",
                                       \"manufacturer\":  \"Emulex Corporation\",
                                       \"model\":  \"LPe32002-AP\",
                                       \"serialnumber\":  \"FC83980875\"
                                   },
                                   {
                                       \"active\":  true,
                                       \"drivername\":  \"elxfc\",
                                       \"driverversion\":  \"12.2.207.0\",
                                       \"firmwareversion\":  \"11.4.204.25\",
                                       \"optionromversion\":  \"11.4.204.25\",
                                       \"manufacturer\":  \"Emulex Corporation\",
                                       \"model\":  \"LPe32002-AP\",
                                       \"serialnumber\":  \"FC83980875\"
                                   }
                               ]
                   },
                   {
                       \"HPE\":  [

                               ]
                   },
                   {
                       \"HPEDiskCount\":  0
                   },
                   {
                       \"HPELogicalDisks\":  {
                                               \"Status\":  null,
                                               \"RaidLevel\":  null,
                                               \"ID\":  null,
                                               \"Capacity\":  null
                                           }
                   },
                   {
                       \"HPEPhysicalDisks\":  [

                                            ]
                   },
                   {
                       \"Mig\":  {
                                   \"VirtualMachineMigrationEnabled\":  true,
                                   \"VirtualMachineMigrationPerformanceOption\":  2,
                                   \"VirtualMachineMigrationAuthenticationType\":  1,
                                   \"MaximumVirtualMachineMigrations\":  2,
                                   \"MaximumStorageMigrations\":  2
                               }
                   },
]
"
| spath input=myJSON
| fields - myJSON, _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Output:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/8743i2A52A30F50C8C2B9/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/8744iF6578A7851BCD882/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Can you give us an example of a field that Splunk is not making available and the SPL you are using?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 09:48:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Parsing-of-highly-nested-JSON-events-with-arrays/m-p/480778#M134709</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2020-04-20T09:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing of highly nested JSON events with arrays</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Parsing-of-highly-nested-JSON-events-with-arrays/m-p/480779#M134710</link>
      <description>&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[adm_compute_qcheck]
INDEXED_EXTRACTIONS = JSON
JSON_TRIM_BRACES_IN_ARRAY_NAMES = true
KV_MODE = none
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;please add your setting.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 10:20:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Parsing-of-highly-nested-JSON-events-with-arrays/m-p/480779#M134710</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-04-20T10:20:11Z</dc:date>
    </item>
  </channel>
</rss>

