<?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 column totals in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/column-totals/m-p/119418#M32043</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I want to add some totals for a search. The search is below, and it works fine.  How would I then add:&lt;/P&gt;

&lt;P&gt;totals for all hosts&lt;BR /&gt;
subtotal by index and sourcetype&lt;/P&gt;

&lt;P&gt;index=ngcc* |fields host, index, sourcetype  |dedup host, index, sourcetype  |table host, index, sourcetype |sort host&lt;/P&gt;</description>
    <pubDate>Wed, 25 Jun 2014 11:32:44 GMT</pubDate>
    <dc:creator>a212830</dc:creator>
    <dc:date>2014-06-25T11:32:44Z</dc:date>
    <item>
      <title>column totals</title>
      <link>https://community.splunk.com/t5/Splunk-Search/column-totals/m-p/119418#M32043</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I want to add some totals for a search. The search is below, and it works fine.  How would I then add:&lt;/P&gt;

&lt;P&gt;totals for all hosts&lt;BR /&gt;
subtotal by index and sourcetype&lt;/P&gt;

&lt;P&gt;index=ngcc* |fields host, index, sourcetype  |dedup host, index, sourcetype  |table host, index, sourcetype |sort host&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2014 11:32:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/column-totals/m-p/119418#M32043</guid>
      <dc:creator>a212830</dc:creator>
      <dc:date>2014-06-25T11:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: column totals</title>
      <link>https://community.splunk.com/t5/Splunk-Search/column-totals/m-p/119419#M32044</link>
      <description>&lt;P&gt;Are you looking to count values by some fields? Take a look at the &lt;CODE&gt;stats&lt;/CODE&gt; command: &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.1/SearchReference/stats"&gt;http://docs.splunk.com/Documentation/Splunk/6.1.1/SearchReference/stats&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I'm not quite sure what your desired result looks like, maybe post an example.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2014 11:46:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/column-totals/m-p/119419#M32044</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-06-25T11:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: column totals</title>
      <link>https://community.splunk.com/t5/Splunk-Search/column-totals/m-p/119420#M32045</link>
      <description>&lt;P&gt;I am not sure what you need to but try this query. It might help you to get what you need:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  index=ngcc*|fields host, index, sourcetype  |dedup host, index, sourcetype  |table host, index, sourcetype |sort host|streamstats count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Jun 2014 12:20:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/column-totals/m-p/119420#M32045</guid>
      <dc:creator>lpolo</dc:creator>
      <dc:date>2014-06-25T12:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: column totals</title>
      <link>https://community.splunk.com/t5/Splunk-Search/column-totals/m-p/119421#M32046</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=ngcc* |fields host, index, sourcetype |dedup host, index, sourcetype |table host, index, sourcetype |sort host | eventstats count as GrandTotal | eventstats count as SubTotal by index, sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR simply&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=ngcc*  |stats count by host, index, sourcetype  | fields - count | stats count as SubTotal by index, sourcetype | eventstats sum(SubTotal) as AllHostTotal
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Jun 2014 12:59:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/column-totals/m-p/119421#M32046</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-06-25T12:59:26Z</dc:date>
    </item>
  </channel>
</rss>

