<?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: Calculate number of events between time intervels in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Calculate-number-of-events-between-time-intervels/m-p/40031#M7439</link>
    <description>&lt;P&gt;Not 100% sure that I understand your reporting needs; &lt;BR /&gt;
 - the total number of events per 24 hours, counting from 22:30 each day. &lt;BR /&gt;
 - Also, you want a the number of events between 11:45 - 13:45 (assumption) where status=exceed&lt;/P&gt;

&lt;P&gt;If you want the 'exceed' events between 11:45 and 01:45 you should change the schedule so that the search runs outside that timeframe, e.g. at 02:00.&lt;/P&gt;

&lt;P&gt;So to the answer;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype = XXX earliest=-1d@d+22h+30m latest=@d+22h+30m 
| stats c as Total
| appendcols 
    [search sourcetype=XXX earliest=-1d@d+11h+45m latest=@d+13h+45m status=exceeded 
    | stats c as "Number of exceeded during my loong lunch"]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Added some indentation so that it's easier to see what happens in the appended search. Set the search to run at 23.00 every day.&lt;/P&gt;

&lt;P&gt;As you might guess, the searches operate independently of each other, and the result will look something like;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Total     Number exceeded during my looong lunch
-----     --------------------------------------
124621    9473
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
    <pubDate>Mon, 20 May 2013 19:11:10 GMT</pubDate>
    <dc:creator>kristian_kolb</dc:creator>
    <dc:date>2013-05-20T19:11:10Z</dc:date>
    <item>
      <title>Calculate number of events between time intervels</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Calculate-number-of-events-between-time-intervels/m-p/40030#M7438</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I would like ti calculate number of events between time in my search.&lt;BR /&gt;
There are 2 status, exceed &amp;amp; within in my query.&lt;BR /&gt;
I want to calculate the number of "exceed" events between 11:45 to 1:45 daily.&lt;BR /&gt;
My query has to run between 22:30 to next day 22:30 to count the total events.&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2013 16:59:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Calculate-number-of-events-between-time-intervels/m-p/40030#M7438</guid>
      <dc:creator>marellasunil</dc:creator>
      <dc:date>2013-05-20T16:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate number of events between time intervels</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Calculate-number-of-events-between-time-intervels/m-p/40031#M7439</link>
      <description>&lt;P&gt;Not 100% sure that I understand your reporting needs; &lt;BR /&gt;
 - the total number of events per 24 hours, counting from 22:30 each day. &lt;BR /&gt;
 - Also, you want a the number of events between 11:45 - 13:45 (assumption) where status=exceed&lt;/P&gt;

&lt;P&gt;If you want the 'exceed' events between 11:45 and 01:45 you should change the schedule so that the search runs outside that timeframe, e.g. at 02:00.&lt;/P&gt;

&lt;P&gt;So to the answer;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype = XXX earliest=-1d@d+22h+30m latest=@d+22h+30m 
| stats c as Total
| appendcols 
    [search sourcetype=XXX earliest=-1d@d+11h+45m latest=@d+13h+45m status=exceeded 
    | stats c as "Number of exceeded during my loong lunch"]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Added some indentation so that it's easier to see what happens in the appended search. Set the search to run at 23.00 every day.&lt;/P&gt;

&lt;P&gt;As you might guess, the searches operate independently of each other, and the result will look something like;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Total     Number exceeded during my looong lunch
-----     --------------------------------------
124621    9473
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2013 19:11:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Calculate-number-of-events-between-time-intervels/m-p/40031#M7439</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-05-20T19:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate number of events between time intervels</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Calculate-number-of-events-between-time-intervels/m-p/40032#M7440</link>
      <description>&lt;P&gt;Hi Kristian, Thank you for the answer, &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; It worked, and also I wrote query in different way, and this also worked. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; .. | count(eval(Report="exceed" and (StartTime&amp;gt;"00:00:00.000" and StartTime&amp;lt;"01:45:00.000") OR StartTime&amp;gt;"23:45:00.000")) as "exceeded count".&lt;/P&gt;

&lt;P&gt;StartTime field already exist in the logs &lt;span class="lia-unicode-emoji" title=":winking_face_with_tongue:"&gt;😜&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2013 20:10:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Calculate-number-of-events-between-time-intervels/m-p/40032#M7440</guid>
      <dc:creator>marellasunil</dc:creator>
      <dc:date>2013-05-20T20:10:29Z</dc:date>
    </item>
  </channel>
</rss>

