<?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: Parsing JSON data in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Parsing-JSON-data/m-p/63871#M12852</link>
    <description>&lt;P&gt;I'm not sure about the dashboard part of the request, but you'd find it easier if you set KV_MODE=JSON in a props.conf entry referencing your sourcetype (on the indexer/search heads). I like to set the &lt;CODE&gt;sourcetype=json&lt;/CODE&gt; for the json input, and then I only need to set up one props.conf entry for all data that I'll be ingesting later. &lt;/P&gt;

&lt;P&gt;The KV_MODE automatically runs spath-like field extractions over the entire event, so you can run a search like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=json source=xyz timings | stats count by timings.cat
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=json source=xyz timings.cpu&amp;gt;1000000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also, if you run your search in "smart" or "verbose" mode, you'll see all your contextual fields on the left with statistics (eg. &lt;CODE&gt;timings.subtimings.find.subtimings.cat&lt;/CODE&gt;). With that in place, it will be easier to glob on fields for charting purposes.&lt;/P&gt;

&lt;P&gt;I think your actual data structure is somewhat cumbersome, though. You may want to have an entity like &lt;CODE&gt;timings.subtimings.operation = find&lt;/CODE&gt;, rather than &lt;CODE&gt;find&lt;/CODE&gt; being a key underneath &lt;CODE&gt;subtimings&lt;/CODE&gt;, that way you can run stats over the values of &lt;CODE&gt;timings.subtimings.operation&lt;/CODE&gt;, which you could do using your structure. The same principle applies further in the nest. Hope that helps a little bit.&lt;/P&gt;</description>
    <pubDate>Sat, 16 Mar 2013 01:08:51 GMT</pubDate>
    <dc:creator>gcoles</dc:creator>
    <dc:date>2013-03-16T01:08:51Z</dc:date>
    <item>
      <title>Parsing JSON data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Parsing-JSON-data/m-p/63870#M12851</link>
      <description>&lt;P&gt;I need to build a dashboard to parse the json data and show it more like Tree Structure.What is the best way, I can build a data structure to be able to run custom queries. I tries use basic spath command as well as using jsontutils jsonkvrecursive command with limited success. Appreciate any help. Here is a sample json data. &lt;/P&gt;

&lt;P&gt;{&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"timings": {
    "cat": "ROOT",
    "el": 597086853,
    "cpu": 256429000,
    "subtimings": {
        "find": {
            "cat": "CODE",
            "el": 500467225,
            "cpu": 218036000,
            "subtimings": {
                "Find - buildMapperObjects": {
                    "cat": "CODE",
                    "el": 6585459,
                    "cpu": 3989000
                },
                "findBySubscriber": {
                    "cat": "CODE",
                    "el": 488985754,
                    "cpu": 211558000,
                    "subtimings": {
                        "findResponseObjects": {
                            "cat": "CODE",
                            "el": 515299,
                            "cpu": 328000
                        },
                        "findSubSqlParamSrc": {
                            "cat": "CODE",
                            "el": 1483307,
                            "cpu": 930000
                        },
                        "executeSPCall": {
                            "cat": "CODE",
                            "el": 152860617,
                            "cpu": 36395000,
                            "aggregates": {
                                "dataSourceCall": {
                                    "cnt": 2,
                                    "el": 22312142
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;}&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2013 22:37:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Parsing-JSON-data/m-p/63870#M12851</guid>
      <dc:creator>Sriram</dc:creator>
      <dc:date>2013-03-15T22:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing JSON data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Parsing-JSON-data/m-p/63871#M12852</link>
      <description>&lt;P&gt;I'm not sure about the dashboard part of the request, but you'd find it easier if you set KV_MODE=JSON in a props.conf entry referencing your sourcetype (on the indexer/search heads). I like to set the &lt;CODE&gt;sourcetype=json&lt;/CODE&gt; for the json input, and then I only need to set up one props.conf entry for all data that I'll be ingesting later. &lt;/P&gt;

&lt;P&gt;The KV_MODE automatically runs spath-like field extractions over the entire event, so you can run a search like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=json source=xyz timings | stats count by timings.cat
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=json source=xyz timings.cpu&amp;gt;1000000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also, if you run your search in "smart" or "verbose" mode, you'll see all your contextual fields on the left with statistics (eg. &lt;CODE&gt;timings.subtimings.find.subtimings.cat&lt;/CODE&gt;). With that in place, it will be easier to glob on fields for charting purposes.&lt;/P&gt;

&lt;P&gt;I think your actual data structure is somewhat cumbersome, though. You may want to have an entity like &lt;CODE&gt;timings.subtimings.operation = find&lt;/CODE&gt;, rather than &lt;CODE&gt;find&lt;/CODE&gt; being a key underneath &lt;CODE&gt;subtimings&lt;/CODE&gt;, that way you can run stats over the values of &lt;CODE&gt;timings.subtimings.operation&lt;/CODE&gt;, which you could do using your structure. The same principle applies further in the nest. Hope that helps a little bit.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Mar 2013 01:08:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Parsing-JSON-data/m-p/63871#M12852</guid>
      <dc:creator>gcoles</dc:creator>
      <dc:date>2013-03-16T01:08:51Z</dc:date>
    </item>
  </channel>
</rss>

