<?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: How to extract the nested array coordinates from JSON? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-the-nested-array-coordinates-from-JSON/m-p/232957#M45428</link>
    <description>&lt;P&gt;Try this in your props.conf:&lt;BR /&gt;
under the sourcetype or monitor stanza:&lt;/P&gt;

&lt;P&gt;Example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[myjson_sourcetype]
EXTRACT-coordinates = `\[\[(?P&amp;lt;coord_1&amp;gt;\S+)],\[(?P&amp;lt;coord_2&amp;gt;\S+)\].+\[(?P&amp;lt;coord_3&amp;gt;\S+)\]\]`
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above will create the 3 fields (coord_1, 2 and 3. Assuming the data comes in like that, you should be good to go. If not, please post more of the data, so we can all take a look.&lt;/P&gt;</description>
    <pubDate>Tue, 11 Oct 2016 17:04:39 GMT</pubDate>
    <dc:creator>sshelly_splunk</dc:creator>
    <dc:date>2016-10-11T17:04:39Z</dc:date>
    <item>
      <title>How to extract the nested array coordinates from JSON?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-the-nested-array-coordinates-from-JSON/m-p/232956#M45427</link>
      <description>&lt;P&gt;Hi !! &lt;BR /&gt;
I am new to Splunk and trying to extract the array coordinates from Json.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"type":"Feature","geometry":{"type":"MultiPoint","coordinates":[[103.62107,1.27478],[103.622,1.29625],  ……., [103.6224,1.28207]]}}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is anyone able to help me out here? &lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2016 10:18:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-the-nested-array-coordinates-from-JSON/m-p/232956#M45427</guid>
      <dc:creator>weiquanswq</dc:creator>
      <dc:date>2016-10-06T10:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract the nested array coordinates from JSON?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-the-nested-array-coordinates-from-JSON/m-p/232957#M45428</link>
      <description>&lt;P&gt;Try this in your props.conf:&lt;BR /&gt;
under the sourcetype or monitor stanza:&lt;/P&gt;

&lt;P&gt;Example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[myjson_sourcetype]
EXTRACT-coordinates = `\[\[(?P&amp;lt;coord_1&amp;gt;\S+)],\[(?P&amp;lt;coord_2&amp;gt;\S+)\].+\[(?P&amp;lt;coord_3&amp;gt;\S+)\]\]`
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above will create the 3 fields (coord_1, 2 and 3. Assuming the data comes in like that, you should be good to go. If not, please post more of the data, so we can all take a look.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2016 17:04:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-the-nested-array-coordinates-from-JSON/m-p/232957#M45428</guid>
      <dc:creator>sshelly_splunk</dc:creator>
      <dc:date>2016-10-11T17:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract the nested array coordinates from JSON?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-the-nested-array-coordinates-from-JSON/m-p/232958#M45429</link>
      <description>&lt;P&gt;I able to achieve the results I want using &lt;STRONG&gt;spath&lt;/STRONG&gt; and extract according to the index.&lt;/P&gt;

&lt;P&gt;My code is as follows: &lt;BR /&gt;
&lt;CODE&gt;... | spath path=features{}.geometry.coordinates{}{0} output=a &lt;BR /&gt;
   | spath path=features{}.geometry.coordinates{}{1} output=b &lt;BR /&gt;
   |  table a b | eval x=mvzip(a,b)| mvexpand x &lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Hope this will be useful.  &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2016 09:01:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-the-nested-array-coordinates-from-JSON/m-p/232958#M45429</guid>
      <dc:creator>weiquanswq</dc:creator>
      <dc:date>2016-10-12T09:01:22Z</dc:date>
    </item>
  </channel>
</rss>

