<?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 parse JSON in Splunk? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-JSON-in-Splunk/m-p/368411#M66926</link>
    <description>&lt;P&gt;Try a variant of this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "(?&amp;lt;json_blob&amp;gt;{.*})" | spath input=json_blob
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You might need to tweak it a little to deal with the square brackets, but the idea is that the rex function isolates the json and then the spath parses out all the values.&lt;/P&gt;</description>
    <pubDate>Fri, 24 Mar 2017 20:55:18 GMT</pubDate>
    <dc:creator>chuckers</dc:creator>
    <dc:date>2017-03-24T20:55:18Z</dc:date>
    <item>
      <title>How to parse JSON in Splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-JSON-in-Splunk/m-p/368410#M66925</link>
      <description>&lt;P&gt;Hi , &lt;/P&gt;

&lt;P&gt;I am using the Splunk REST API to call a rest service and i need to parse the data to Splunk. &lt;/P&gt;

&lt;P&gt;We are getting the response like this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[{"port":"port1" , "version" :"1.o"},{"port":"port1" , "version" :"1.o"}]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However when i index this data to a JSON source type, i am not able to see the data in JSON format clearly and getting an response like this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[ [-] 
   { [+] 
   } 
   { [+] 
   } 
]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But if save the response to a JSON file and add that as input, we are able to get the data in correct format in Splunk.&lt;BR /&gt;
Do we have a way to fix this?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2017 13:22:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-JSON-in-Splunk/m-p/368410#M66925</guid>
      <dc:creator>SuganyaSSF</dc:creator>
      <dc:date>2017-03-21T13:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse JSON in Splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-JSON-in-Splunk/m-p/368411#M66926</link>
      <description>&lt;P&gt;Try a variant of this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "(?&amp;lt;json_blob&amp;gt;{.*})" | spath input=json_blob
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You might need to tweak it a little to deal with the square brackets, but the idea is that the rex function isolates the json and then the spath parses out all the values.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 20:55:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-JSON-in-Splunk/m-p/368411#M66926</guid>
      <dc:creator>chuckers</dc:creator>
      <dc:date>2017-03-24T20:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse JSON in Splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-JSON-in-Splunk/m-p/368412#M66927</link>
      <description>&lt;P&gt;Do you see your data when you expand the objects by clicking the plus icon?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 12:43:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-JSON-in-Splunk/m-p/368412#M66927</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2017-04-07T12:43:51Z</dc:date>
    </item>
  </channel>
</rss>

