<?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 number of events in a search result? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-number-of-events-in-a-search-result/m-p/90556#M23258</link>
    <description>&lt;P&gt;I finally found something that works, but it is a slow way of doing it. &lt;/P&gt;

&lt;P&gt;index=* [|inputcsv allhosts.csv] | stats count by host | stats count AS totalReportingHosts| appendcols [| inputlookup allhosts.csv | stats count AS totalAssets]&lt;/P&gt;</description>
    <pubDate>Fri, 06 Jun 2014 03:03:36 GMT</pubDate>
    <dc:creator>stevenatmit</dc:creator>
    <dc:date>2014-06-06T03:03:36Z</dc:date>
    <item>
      <title>How to count number of events in a search result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-number-of-events-in-a-search-result/m-p/90553#M23255</link>
      <description>&lt;P&gt;The objective of this search is to count the number of events in a search result.  This is the current search logic that I am using (which uses the linecount command):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="my_source" filter_result="hello_world" | stats sum(linecount) as Total
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is there an "eventcount" command that simply counts the number of events that I can use instead of "linecount"?  The reason is that linecount sometimes over-counts some results (i.e. it will count 100 when there are actually only 75 events).&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2013 15:03:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-number-of-events-in-a-search-result/m-p/90553#M23255</guid>
      <dc:creator>echojacques</dc:creator>
      <dc:date>2013-10-09T15:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to count number of events in a search result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-number-of-events-in-a-search-result/m-p/90554#M23256</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;

&lt;P&gt;Linecount is the number of lines per event&lt;/P&gt;

&lt;P&gt;I guess you are looking for something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="my_source" filter_result="hello_world" | stats count as Total
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2013 15:07:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-number-of-events-in-a-search-result/m-p/90554#M23256</guid>
      <dc:creator>gfuente</dc:creator>
      <dc:date>2013-10-09T15:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to count number of events in a search result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-number-of-events-in-a-search-result/m-p/90555#M23257</link>
      <description>&lt;P&gt;Yes, this is exactly what I was looking for.  I just tested it and it works.  Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2013 15:09:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-number-of-events-in-a-search-result/m-p/90555#M23257</guid>
      <dc:creator>echojacques</dc:creator>
      <dc:date>2013-10-09T15:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to count number of events in a search result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-number-of-events-in-a-search-result/m-p/90556#M23258</link>
      <description>&lt;P&gt;I finally found something that works, but it is a slow way of doing it. &lt;/P&gt;

&lt;P&gt;index=* [|inputcsv allhosts.csv] | stats count by host | stats count AS totalReportingHosts| appendcols [| inputlookup allhosts.csv | stats count AS totalAssets]&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jun 2014 03:03:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-number-of-events-in-a-search-result/m-p/90556#M23258</guid>
      <dc:creator>stevenatmit</dc:creator>
      <dc:date>2014-06-06T03:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to count number of events in a search result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-number-of-events-in-a-search-result/m-p/90557#M23259</link>
      <description>&lt;P&gt;Here is a way to count events per minute if you search in hours:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* | timechart count(_raw) span=1h
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Dec 2015 16:58:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-number-of-events-in-a-search-result/m-p/90557#M23259</guid>
      <dc:creator>bbialek</dc:creator>
      <dc:date>2015-12-17T16:58:54Z</dc:date>
    </item>
  </channel>
</rss>

