<?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 count the size of json array of a single event in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-size-of-json-array-of-a-single-event/m-p/103568#M26771</link>
    <description>&lt;P&gt;You can use the spath command.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;your_search |  spath path=a{} output=name | stats count(name) as name&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Spath" target="test_blank"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Spath&lt;/A&gt;&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Oct 2013 11:39:08 GMT</pubDate>
    <dc:creator>alacercogitatus</dc:creator>
    <dc:date>2013-10-17T11:39:08Z</dc:date>
    <item>
      <title>How to count the size of json array of a single event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-size-of-json-array-of-a-single-event/m-p/103567#M26770</link>
      <description>&lt;P&gt;How to count the size of json array of a single event&lt;/P&gt;

&lt;P&gt;For example {"a" : [{"b": true}, {"b": true}, {"c": true}]}&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;name   size
===========
a      3
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Oct 2013 10:52:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-size-of-json-array-of-a-single-event/m-p/103567#M26770</guid>
      <dc:creator>wood1986</dc:creator>
      <dc:date>2013-10-17T10:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the size of json array of a single event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-size-of-json-array-of-a-single-event/m-p/103568#M26771</link>
      <description>&lt;P&gt;You can use the spath command.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;your_search |  spath path=a{} output=name | stats count(name) as name&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Spath" target="test_blank"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Spath&lt;/A&gt;&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2013 11:39:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-size-of-json-array-of-a-single-event/m-p/103568#M26771</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2013-10-17T11:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the size of json array of a single event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-size-of-json-array-of-a-single-event/m-p/103569#M26772</link>
      <description>&lt;P&gt;my example is too simple. for a single event&lt;BR /&gt;
{"id": 32413&lt;BR /&gt;
"a" : [{"b": true}, {"b": true}, {"c": true}].&lt;BR /&gt;
"z" : [{"a": 1}, {"d":2}]}&lt;/P&gt;

&lt;P&gt;I want this output&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;id    a    z
=============
32413  3    2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Oct 2013 14:12:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-size-of-json-array-of-a-single-event/m-p/103569#M26772</guid>
      <dc:creator>wood1986</dc:creator>
      <dc:date>2013-10-17T14:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the size of json array of a single event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-size-of-json-array-of-a-single-event/m-p/103570#M26773</link>
      <description>&lt;P&gt;&lt;CODE&gt;your_search | spath path=a{} output=aName | spath path=z{} output=zName | stats count(aName) as a count(zName) as z by id&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2013 16:30:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-size-of-json-array-of-a-single-event/m-p/103570#M26773</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2013-10-17T16:30:56Z</dc:date>
    </item>
  </channel>
</rss>

