<?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 do I parse JSON events from a custom generating command that queries an API? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-parse-JSON-events-from-a-custom-generating-command-that/m-p/376095#M68095</link>
    <description>&lt;P&gt;Thank you! It worked as expected.&lt;/P&gt;</description>
    <pubDate>Mon, 05 Nov 2018 15:43:42 GMT</pubDate>
    <dc:creator>yogevyuval</dc:creator>
    <dc:date>2018-11-05T15:43:42Z</dc:date>
    <item>
      <title>How do I parse JSON events from a custom generating command that queries an API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-parse-JSON-events-from-a-custom-generating-command-that/m-p/376093#M68093</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have an external API that I want to be able to let my users explore with Splunk.&lt;/P&gt;

&lt;P&gt;This API returns a list of deeply nested events in JSON format.&lt;/P&gt;

&lt;P&gt;I managed to query the API myself and send the events to Splunk, and this approach works well in terms of indexing of the data.&lt;/P&gt;

&lt;P&gt;However, I would like to give my users a faster and more intuitive way of exploring the data so I decided to write a custom Splunk command that would query the API on the fly and let the users search the data — so my command looks something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| &amp;lt;my_custom_command&amp;gt; | stats count by ....
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The problem I encountered is that the JSON returned from this generating command is not being parsed well by Splunk. It seems like only the top-level fields have been extracted and their value is just the rest of the JSON.&lt;/P&gt;

&lt;P&gt;I understand that a custom command is run after indexing, but this approach of a custom command gives me the flexibility that I want, so I would really be happy to find a way to parse my events successfully.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Nov 2018 16:09:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-parse-JSON-events-from-a-custom-generating-command-that/m-p/376093#M68093</guid>
      <dc:creator>yogevyuval</dc:creator>
      <dc:date>2018-11-04T16:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do I parse JSON events from a custom generating command that queries an API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-parse-JSON-events-from-a-custom-generating-command-that/m-p/376094#M68094</link>
      <description>&lt;P&gt;Assuming your custom command yields a &lt;CODE&gt;_raw&lt;/CODE&gt; string containing the json, just like an already-index event would look like, you'll probably want to call the &lt;CODE&gt;spath&lt;/CODE&gt; command to parse the json string into fields.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Nov 2018 20:22:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-parse-JSON-events-from-a-custom-generating-command-that/m-p/376094#M68094</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2018-11-04T20:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do I parse JSON events from a custom generating command that queries an API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-parse-JSON-events-from-a-custom-generating-command-that/m-p/376095#M68095</link>
      <description>&lt;P&gt;Thank you! It worked as expected.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Nov 2018 15:43:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-parse-JSON-events-from-a-custom-generating-command-that/m-p/376095#M68095</guid>
      <dc:creator>yogevyuval</dc:creator>
      <dc:date>2018-11-05T15:43:42Z</dc:date>
    </item>
  </channel>
</rss>

