<?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 do I get a large count of events over a period of time? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-large-count-of-events-over-a-period-of-time/m-p/355808#M105248</link>
    <description>&lt;P&gt;try something like that (use the metadata, will be fast)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count where index=myindex sourcetype=mysourcetype by _time span=60m | where count &amp;lt;900000
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 29 Apr 2017 14:08:21 GMT</pubDate>
    <dc:creator>maraman_splunk</dc:creator>
    <dc:date>2017-04-29T14:08:21Z</dc:date>
    <item>
      <title>How do I get a large count of events over a period of time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-large-count-of-events-over-a-period-of-time/m-p/355807#M105247</link>
      <description>&lt;P&gt;I'm trying to write a search string that will count firewall events up to 900k over 60 minutes to trigger an alarm when the  event count goes under the 900k events. However, after reviewing the job using the search string below with the time range set in the drop down, I noticed that the search job scans 931k events before reaching the 900k count.  Aside from the 31k additional events returned, the search takes a while to run (1-2 min).&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;index=some_index sourcetype=some_stype | head 900000 | eventstats count | eval counts = tostring(count, "commas") | dedup count | table counts&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I've also toyed with the metadata command to calculate traffic flow which runs significantly faster, but I'm not familiar with it enough to know if it's a viable solution. Any help or guidance would be appreciated. &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:53:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-large-count-of-events-over-a-period-of-time/m-p/355807#M105247</guid>
      <dc:creator>eli_mz</dc:creator>
      <dc:date>2020-09-29T13:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get a large count of events over a period of time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-large-count-of-events-over-a-period-of-time/m-p/355808#M105248</link>
      <description>&lt;P&gt;try something like that (use the metadata, will be fast)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count where index=myindex sourcetype=mysourcetype by _time span=60m | where count &amp;lt;900000
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 29 Apr 2017 14:08:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-large-count-of-events-over-a-period-of-time/m-p/355808#M105248</guid>
      <dc:creator>maraman_splunk</dc:creator>
      <dc:date>2017-04-29T14:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get a large count of events over a period of time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-large-count-of-events-over-a-period-of-time/m-p/355809#M105249</link>
      <description>&lt;P&gt;First, your search will run much faster if you use &lt;CODE&gt;tstats&lt;/CODE&gt;. &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| tstats count where index=some_index sourcetype=some_stype&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;What is unclear though is the best way to use it, because I a not quite understanding what output you want. Do you just want to trigger an alert via a saved search when the count is under 900K? Are you going to limit the search to &lt;CODE&gt;earliest=-60m&lt;/CODE&gt; or do you plan to search over a longer period and want to look in 60 minute buckets? &lt;/P&gt;</description>
      <pubDate>Sat, 29 Apr 2017 17:11:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-large-count-of-events-over-a-period-of-time/m-p/355809#M105249</guid>
      <dc:creator>rjthibod</dc:creator>
      <dc:date>2017-04-29T17:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get a large count of events over a period of time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-large-count-of-events-over-a-period-of-time/m-p/355810#M105250</link>
      <description>&lt;P&gt;definitely go with tstats, also, what is the goal of counting up to 900k but alarming under??&lt;/P&gt;

&lt;P&gt;Seems like a strange threshold for firewall traffic alarming...&lt;/P&gt;</description>
      <pubDate>Sat, 29 Apr 2017 17:19:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-large-count-of-events-over-a-period-of-time/m-p/355810#M105250</guid>
      <dc:creator>mattymo</dc:creator>
      <dc:date>2017-04-29T17:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get a large count of events over a period of time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-large-count-of-events-over-a-period-of-time/m-p/355811#M105251</link>
      <description>&lt;P&gt;The search is going to be limited to a 60 minute bucket. I'm planning on running this from a saved search.&lt;/P&gt;

&lt;P&gt;The idea is to trigger an alert when the events created\forwarded fall below 900k events as an indicator of potential issues. I've had instances where the box is up and running but the events are not being forwarded.&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2017 14:09:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-large-count-of-events-over-a-period-of-time/m-p/355811#M105251</guid>
      <dc:creator>eli_mz</dc:creator>
      <dc:date>2017-05-01T14:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get a large count of events over a period of time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-large-count-of-events-over-a-period-of-time/m-p/355812#M105252</link>
      <description>&lt;P&gt;The idea is to trigger an alert when the events created\forwarded fall below 900k events as an indicator of potential issues. I've had instances where the box is up and running and seemingly running normally (no network issues) but the events are not being forwarded. Looking at one of those events overtime I can see the events coming in at a decreasing rate before it finally reaches "0".&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2017 14:09:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-large-count-of-events-over-a-period-of-time/m-p/355812#M105252</guid>
      <dc:creator>eli_mz</dc:creator>
      <dc:date>2017-05-01T14:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get a large count of events over a period of time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-large-count-of-events-over-a-period-of-time/m-p/355813#M105253</link>
      <description>&lt;P&gt;Then this saved search should work. You will need to setup the alert conditions to look for any results (i.e., resultCount &amp;gt; 0).&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| tstats count where index=some_index sourcetype=some_stype | where count &amp;lt; 900000&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2017 14:12:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-large-count-of-events-over-a-period-of-time/m-p/355813#M105253</guid>
      <dc:creator>rjthibod</dc:creator>
      <dc:date>2017-05-01T14:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get a large count of events over a period of time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-large-count-of-events-over-a-period-of-time/m-p/355814#M105254</link>
      <description>&lt;P&gt;Yup, this will work for my purpose. Off to do a bit more reading. Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2017 15:12:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-large-count-of-events-over-a-period-of-time/m-p/355814#M105254</guid>
      <dc:creator>eli_mz</dc:creator>
      <dc:date>2017-05-01T15:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get a large count of events over a period of time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-large-count-of-events-over-a-period-of-time/m-p/355815#M105255</link>
      <description>&lt;P&gt;Excellent. This will work for my purpose.  &lt;/P&gt;

&lt;P&gt;Both &lt;A href="https://answers.splunk.com/users/251878/rjthibod.html?utm_source=answers&amp;amp;utm_medium=email&amp;amp;utm_term=%20rjthibod%20&amp;amp;utm_content=&amp;amp;utm_campaign=mention"&gt;rjhibod&lt;/A&gt; and &lt;A href="https://answers.splunk.com/users/394281/mmodestino-splunk.html?utm_source=answers&amp;amp;utm_medium=email&amp;amp;utm_term=%20mmodestino%20&amp;amp;utm_content=&amp;amp;utm_campaign=mention"&gt;mmodestino&lt;/A&gt; pointed me to that as well. Thank you all.&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2017 15:14:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-large-count-of-events-over-a-period-of-time/m-p/355815#M105255</guid>
      <dc:creator>eli_mz</dc:creator>
      <dc:date>2017-05-01T15:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get a large count of events over a period of time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-large-count-of-events-over-a-period-of-time/m-p/355816#M105256</link>
      <description>&lt;P&gt;The &lt;CODE&gt;by _time span=60m&lt;/CODE&gt; will break up all of history into 60 minute chunks and report if ANY of them are below 900K.  &lt;/P&gt;

&lt;P&gt;Just use &lt;CODE&gt;earliest=-1h&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2017 15:31:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-large-count-of-events-over-a-period-of-time/m-p/355816#M105256</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-05-01T15:31:57Z</dc:date>
    </item>
  </channel>
</rss>

