<?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: Configuring field extractions for multivalue nested JSON events in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Configuring-field-extractions-for-multivalue-nested-JSON-events/m-p/344667#M102104</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Can you try something like this in search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  | extract pairdelim="\r\n" kvdelim=":"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Let me know what it gives.&lt;/P&gt;</description>
    <pubDate>Sat, 10 Mar 2018 09:41:46 GMT</pubDate>
    <dc:creator>p_gurav</dc:creator>
    <dc:date>2018-03-10T09:41:46Z</dc:date>
    <item>
      <title>Configuring field extractions for multivalue nested JSON events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Configuring-field-extractions-for-multivalue-nested-JSON-events/m-p/344664#M102101</link>
      <description>&lt;P&gt;Hi experts,&lt;/P&gt;

&lt;P&gt;I am working with nested JSON events which look as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{   [-] 
     compliance:  &amp;lt;compliance_state&amp;gt;    
     ctupdate:  hostinfo    
     host_properties:   {   [-] 
         hwi_computer:  [   [+] 
        ]   
         hwi_disk:  [   [-] 
        {   [-] 
             counteract_tag:     health_data    
             since:  1519929479 
             value:  Device ID: C:;Drive Type: Local Disk;Free Space (Megabytes): 93159.7578125;Size (Megabytes): 122776.99609375;Name: C:;Description: Local Fixed Disk;Media Type: Fixed hard disk media;File System: NTFS    
        }   
        {   [-] 
             counteract_tag:     health_data    
             since:  1519929479 
             value:  Device ID: A:;Drive Type: Removable Disk;Name: A:;Description: 3 1/2 Inch Floppy Drive;Media Type: 3 1/2-Inch Floppy Disk - 720 KB - 512 bytes/sector; 
        }   
        {   [-] 
             counteract_tag:     health_data    
             since:  1519929479 
             value:  Device ID: D:;Drive Type: Compact Disc;Name: D:;Description: CD-ROM Disc;Media Type: Removable media other than floppy;    
        }   
        ]   
         hwi_network_adapters:  [   [+] 
        ]   
         hwi_physical_memory:   [   [+] 
        ]   
         hwi_processor: [   [+] 
        ]   
    }   
     ip:     &amp;lt;ipv4_address&amp;gt; 
     ipv6:   &amp;lt;ipv6_address&amp;gt; 
     mac:    &amp;lt;mac_address&amp;gt;  
     nbtdomain:  &amp;lt;domain&amp;gt;   
     user:   &amp;lt;user&amp;gt;
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above event contains a host_property named 'hwi_disk' which contains another JSON array carrying disk details of an endpoint under the key named 'value'. This 'value' contains different sub-keys separated by ':' and ';'. So far, I've been writing search queries using regexes to create my dashboards. The search queries look like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;`get_index` `get_sourcetypes` `ct_hostinfo` hwi_disk
| rename host_properties.hwi_disk{}.value as hwi_disk_val
| mvexpand hwi_disk_val
| rex field=hwi_disk_val "Device ID:\s*(?&amp;lt;DeviceID&amp;gt;[^;^$]*).*Free Space \(Megabytes\):\s*(?&amp;lt;FreeSpace&amp;gt;[^;^$]*).*Size \(Megabytes\):\s*(?&amp;lt;Size&amp;gt;[^;^$]*).*"
| stats latest(FreeSpace) as "Disk Space Available (MB)" latest(Size) as "Capacity (MB)" by ip DeviceID
| sort limit=10 -"Disk Space Available (MB)"
| rename ip as IP DeviceID as "Device ID"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would like to know if I can write field extractions for such a multi-value event using conf files? Some pointers on how such extractions can written would be great help!&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:24:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Configuring-field-extractions-for-multivalue-nested-JSON-events/m-p/344664#M102101</guid>
      <dc:creator>sharad06</dc:creator>
      <dc:date>2020-09-29T18:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring field extractions for multivalue nested JSON events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Configuring-field-extractions-for-multivalue-nested-JSON-events/m-p/344665#M102102</link>
      <description>&lt;P&gt;You can use KV_MODE=JSON on SH if your JSON syntax is valid.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Mar 2018 05:15:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Configuring-field-extractions-for-multivalue-nested-JSON-events/m-p/344665#M102102</guid>
      <dc:creator>valiquet</dc:creator>
      <dc:date>2018-03-10T05:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring field extractions for multivalue nested JSON events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Configuring-field-extractions-for-multivalue-nested-JSON-events/m-p/344666#M102103</link>
      <description>&lt;P&gt;KV_MODE=JSON can not extract fields for nested JSON events.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Mar 2018 06:53:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Configuring-field-extractions-for-multivalue-nested-JSON-events/m-p/344666#M102103</guid>
      <dc:creator>sharad06</dc:creator>
      <dc:date>2018-03-10T06:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring field extractions for multivalue nested JSON events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Configuring-field-extractions-for-multivalue-nested-JSON-events/m-p/344667#M102104</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Can you try something like this in search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  | extract pairdelim="\r\n" kvdelim=":"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Let me know what it gives.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Mar 2018 09:41:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Configuring-field-extractions-for-multivalue-nested-JSON-events/m-p/344667#M102104</guid>
      <dc:creator>p_gurav</dc:creator>
      <dc:date>2018-03-10T09:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring field extractions for multivalue nested JSON events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Configuring-field-extractions-for-multivalue-nested-JSON-events/m-p/344668#M102105</link>
      <description>&lt;P&gt;Hi p_gaurav,&lt;/P&gt;

&lt;P&gt;Thanks for your reply. I used the following query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;`get_index` `get_sourcetypes` `ct_hostinfo` hwi_network_adapters
| rename host_properties.hwi_network_adapters{}.value as hwi_network_adapters_val
| mvexpand hwi_network_adapters_val
| extract pairdelim="\r\n" kvdelim=":"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But it doesn't extract any of the nested values. I can see why as well because I want to run this 'extract command' on 'hwi_network_adapters_val' field, but to my knowledge, I can't specify a field parameter with 'extract' command (like I can do with the 'rex' command).&lt;/P&gt;

&lt;P&gt;Finally, the greater challenge is to figure out how will this field extraction config translate to props.conf and transforms.conf stanzas.&lt;/P&gt;

&lt;P&gt;Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:22:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Configuring-field-extractions-for-multivalue-nested-JSON-events/m-p/344668#M102105</guid>
      <dc:creator>sharad06</dc:creator>
      <dc:date>2020-09-29T18:22:36Z</dc:date>
    </item>
  </channel>
</rss>

