<?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: Extract data from Jason in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Extract-data-from-Jason/m-p/352155#M93404</link>
    <description>&lt;P&gt;can you give me a complete search query?&lt;/P&gt;

&lt;P&gt;I am doing,&lt;BR /&gt;
index=* | table date, site&lt;/P&gt;</description>
    <pubDate>Wed, 31 Jan 2018 20:46:10 GMT</pubDate>
    <dc:creator>ppanchal</dc:creator>
    <dc:date>2018-01-31T20:46:10Z</dc:date>
    <item>
      <title>Extract data from Jason</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-data-from-Jason/m-p/352153#M93402</link>
      <description>&lt;P&gt;Hi, &lt;BR /&gt;
I want to extract fields like date, site, etc from the below log (jason), how can I do this?&lt;/P&gt;

&lt;P&gt;[{"date":"2018-01-30","site":"S01027","routePublishCount":"17","routeCount":"97","customerCount":"931"},{"date":"2018-01-30","site":"S02923","routePublishCount":"16","routeCount":"119","customerCount":"1248"},{"date":"2018-01-30","site":"S03175","routePublishCount":"14","routeCount":"79","customerCount":"701"},{"date":"2018-01-30","site":"S03422","routePublishCount":"24","routeCount":"146","customerCount":"1486"}]&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2018 20:19:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-data-from-Jason/m-p/352153#M93402</guid>
      <dc:creator>ppanchal</dc:creator>
      <dc:date>2018-01-31T20:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: Extract data from Jason</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-data-from-Jason/m-p/352154#M93403</link>
      <description>&lt;P&gt;Splunk can do some automatic handling of Json. After your initial search command, try piping either&lt;BR /&gt;
| spath&lt;BR /&gt;
or &lt;BR /&gt;
| extract pairdelim="{,}" kvdelim=":"&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2018 20:30:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-data-from-Jason/m-p/352154#M93403</guid>
      <dc:creator>anthonymelita</dc:creator>
      <dc:date>2018-01-31T20:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: Extract data from Jason</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-data-from-Jason/m-p/352155#M93404</link>
      <description>&lt;P&gt;can you give me a complete search query?&lt;/P&gt;

&lt;P&gt;I am doing,&lt;BR /&gt;
index=* | table date, site&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2018 20:46:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-data-from-Jason/m-p/352155#M93404</guid>
      <dc:creator>ppanchal</dc:creator>
      <dc:date>2018-01-31T20:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: Extract data from Jason</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-data-from-Jason/m-p/352156#M93405</link>
      <description>&lt;P&gt;I didn't pay close attention to your example being a single event multivalue json, so not entirely sure this will work:&lt;/P&gt;

&lt;P&gt;index=* &lt;BR /&gt;
| extract pairdelim="{,}" kvdelim=":"&lt;BR /&gt;
| table date, site&lt;/P&gt;

&lt;P&gt;there are other commands for handling multivalue like &lt;CODE&gt;mvexpand&lt;/CODE&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2018 22:17:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-data-from-Jason/m-p/352156#M93405</guid>
      <dc:creator>anthonymelita</dc:creator>
      <dc:date>2018-01-31T22:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: Extract data from Jason</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-data-from-Jason/m-p/352157#M93406</link>
      <description>&lt;P&gt;Not sure why but the above query is returning only single value from the jason. Please help.&lt;/P&gt;

&lt;P&gt;date             site&lt;BR /&gt;
2018-01-30  S01027&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 00:20:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-data-from-Jason/m-p/352157#M93406</guid>
      <dc:creator>ppanchal</dc:creator>
      <dc:date>2018-02-01T00:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: Extract data from Jason</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-data-from-Jason/m-p/352158#M93407</link>
      <description>&lt;P&gt;hey try this run anywhere search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="[{\"date\":\"2018-01-30\",\"site\":\"S01027\",\"routePublishCount\":\"17\",\"routeCount\":\"97\",\"customerCount\":\"931\"},{\"date\":\"2018-01-30\",\"site\":\"S02923\",\"routePublishCount\":\"16\",\"routeCount\":\"119\",\"customerCount\":\"1248\"},{\"date\":\"2018-01-30\",\"site\":\"S03175\",\"routePublishCount\":\"14\",\"routeCount\":\"79\",\"customerCount\":\"701\"},{\"date\":\"2018-01-30\",\"site\":\"S03422\",\"routePublishCount\":\"24\",\"routeCount\":\"146\",\"customerCount\":\"1486\"}]" 
| spath 
| rename {}.* as *
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In your environment, you should try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=&amp;lt;your_index&amp;gt; 
| spath 
| rename {}.* as * 
| table date site
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;let me know if this helps!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 06:45:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-data-from-Jason/m-p/352158#M93407</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-02-01T06:45:47Z</dc:date>
    </item>
  </channel>
</rss>

