<?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: Dealing with badly structured json events in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Dealing-with-badly-structured-json-events/m-p/151187#M30765</link>
    <description>&lt;P&gt;You need a two-step approach:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | spath vulnerable_hosts{} output=vulnerable_hosts | mvexpand vulnerable_hosts | spath input=vulnerable_hosts
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;First you extract the objects inside the &lt;CODE&gt;vulnerable_hosts&lt;/CODE&gt; array, then you turn them into individual events, finally you extract the content of those objects.&lt;/P&gt;</description>
    <pubDate>Fri, 31 Jul 2015 23:23:57 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2015-07-31T23:23:57Z</dc:date>
    <item>
      <title>Dealing with badly structured json events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Dealing-with-badly-structured-json-events/m-p/151186#M30764</link>
      <description>&lt;P&gt;I am pulling in some json events that are poorly structured (at least for my needs).  Specifically, I need to be able to tie the VULNS data to its ip address, which is above it.  But since they are not nested, splunk is not able to make the connection.  Is there any way to tie the IP address to the data below it or readjust the nesting of the event in a search?&lt;/P&gt;

&lt;P&gt;Example data below&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;vulnerable_hosts: [ [-] 
         { [-] 
            ip_address:  xxx.xxx.xxx.xxx 
            vulns: [ [-] 
             { [-] 
                risk_level:  High 
                service_port:  443 
                service_protocol:  TCP 
                title:  SSL/TLS server supports RC4 ciphers 
             } 
             { [-] 
                risk_level:  Medium 
                service_port:  80 
                service_protocol:  TCP 
                title:  TCP timestamp requests enabled 
             } 
             { [-] 
                risk_level:  Medium 
                service_port:  443 
                service_protocol:  TCP 
                title:  SSL certificate is signed with weak hash function: SHA1 
             } 
           ] 
         } 
         { [-] 
            ip_address:  yyy.yyy.yyy.yyy 
            vulns: [ [-] 
             { [-] 
                risk_level:  Urgent 
                service_port:  161 
                service_protocol:  UDP 
                title:  SNMP is enabled and may be vulnerable 
             } 
             { [-] 
                risk_level:  Low 
                service_port:  0 
                service_protocol:  ICMP 
                title:  ICMP timestamp requests enabled 
             } 
           ] 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 31 Jul 2015 22:51:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Dealing-with-badly-structured-json-events/m-p/151186#M30764</guid>
      <dc:creator>david_rose</dc:creator>
      <dc:date>2015-07-31T22:51:10Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with badly structured json events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Dealing-with-badly-structured-json-events/m-p/151187#M30765</link>
      <description>&lt;P&gt;You need a two-step approach:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | spath vulnerable_hosts{} output=vulnerable_hosts | mvexpand vulnerable_hosts | spath input=vulnerable_hosts
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;First you extract the objects inside the &lt;CODE&gt;vulnerable_hosts&lt;/CODE&gt; array, then you turn them into individual events, finally you extract the content of those objects.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2015 23:23:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Dealing-with-badly-structured-json-events/m-p/151187#M30765</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-07-31T23:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with badly structured json events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Dealing-with-badly-structured-json-events/m-p/151188#M30766</link>
      <description>&lt;P&gt;Thanks Martin.  But with this method,  how can I connect the vulnerability to the the correct ip ?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Aug 2015 14:05:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Dealing-with-badly-structured-json-events/m-p/151188#M30766</guid>
      <dc:creator>david_rose</dc:creator>
      <dc:date>2015-08-03T14:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with badly structured json events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Dealing-with-badly-structured-json-events/m-p/151189#M30767</link>
      <description>&lt;P&gt;Ignore that, it was there, just not presented in the events.  You rock!&lt;/P&gt;</description>
      <pubDate>Mon, 03 Aug 2015 15:21:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Dealing-with-badly-structured-json-events/m-p/151189#M30767</guid>
      <dc:creator>david_rose</dc:creator>
      <dc:date>2015-08-03T15:21:47Z</dc:date>
    </item>
  </channel>
</rss>

