<?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 How to parse json file to create a table for application usage. in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-json-file-to-create-a-table-for-application-usage/m-p/183485#M36728</link>
    <description>&lt;P&gt;Hello, &lt;/P&gt;

&lt;P&gt;I have the following data in a json file:&lt;/P&gt;

&lt;P&gt;Format is application: days since last used. &lt;BR /&gt;
&lt;CODE&gt;&lt;BR /&gt;
{&lt;BR /&gt;
   "AdobePhotoshop": "34",&lt;BR /&gt;
   "VmWareFusion": "6"&lt;BR /&gt;
 }&lt;BR /&gt;
&lt;/CODE&gt;&lt;BR /&gt;
I want to create a table that counts the number of machines within a given time range that looks something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Application     usage last 7 days       usage 7-30   usage 30-90   usage over 90-
AdobePhoto                 4                            1                    5                      0
VmWareFusion             6                            5                    0                      1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any ideas? Also does it make sense to store the data in a json format or is there a better option? Thanks!&lt;/P&gt;</description>
    <pubDate>Mon, 27 Oct 2014 18:33:09 GMT</pubDate>
    <dc:creator>gbatye</dc:creator>
    <dc:date>2014-10-27T18:33:09Z</dc:date>
    <item>
      <title>How to parse json file to create a table for application usage.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-json-file-to-create-a-table-for-application-usage/m-p/183485#M36728</link>
      <description>&lt;P&gt;Hello, &lt;/P&gt;

&lt;P&gt;I have the following data in a json file:&lt;/P&gt;

&lt;P&gt;Format is application: days since last used. &lt;BR /&gt;
&lt;CODE&gt;&lt;BR /&gt;
{&lt;BR /&gt;
   "AdobePhotoshop": "34",&lt;BR /&gt;
   "VmWareFusion": "6"&lt;BR /&gt;
 }&lt;BR /&gt;
&lt;/CODE&gt;&lt;BR /&gt;
I want to create a table that counts the number of machines within a given time range that looks something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Application     usage last 7 days       usage 7-30   usage 30-90   usage over 90-
AdobePhoto                 4                            1                    5                      0
VmWareFusion             6                            5                    0                      1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any ideas? Also does it make sense to store the data in a json format or is there a better option? Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 27 Oct 2014 18:33:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-json-file-to-create-a-table-for-application-usage/m-p/183485#M36728</guid>
      <dc:creator>gbatye</dc:creator>
      <dc:date>2014-10-27T18:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse json file to create a table for application usage.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-json-file-to-create-a-table-for-application-usage/m-p/183486#M36729</link>
      <description>&lt;P&gt;I'd prefer to store the data in JSON with standardized field names, something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"Applications": [
  {"Name": "AdobePhotoshop", "DaysSinceLastUse", "34"},
  {"Name": "VmWareFusion", "DaysSinceLastUse", "6"}
]}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That makes using the data very easy, you could extract the fields using &lt;CODE&gt;spath&lt;/CODE&gt; or the appropriate props.conf settings (I think &lt;CODE&gt;indexed_extractions = JSON&lt;/CODE&gt;), and run very easy statistics over the values, e.g. splitting by app name. Adding further properties to an application object is very simple to do here.&lt;/P&gt;

&lt;P&gt;As your data is now, using the JSON field name makes the following search pipeline extremely clumsy, if at all feasible. It'd likely be better to regex those fields from there than relying on the JSON field names. Basically, this is no real object structure (the O in JSON).&lt;/P&gt;</description>
      <pubDate>Mon, 27 Oct 2014 22:50:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-json-file-to-create-a-table-for-application-usage/m-p/183486#M36729</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-10-27T22:50:12Z</dc:date>
    </item>
  </channel>
</rss>

