<?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 How to compare number of events during two specific time periods and display status according to result ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-number-of-events-during-two-specific-time-periods/m-p/136936#M37476</link>
    <description>&lt;P&gt;I’d like to compare 1) the number of events received in the last 30 minutes with 2) the average number of events received in the last 30 calendar days (reduced to a 30 minutes span)&lt;/P&gt;

&lt;P&gt;If the result of 1) exceeds by 50% the result of 2), I’d like to have something like “warning”, otherwise “normal”.&lt;/P&gt;

&lt;P&gt;I’ve come up with the following search but it doesn’t seem to be working and I cannot figure out what is wrong with it (I’m pretty sure it’s right under my nose)&lt;/P&gt;

&lt;P&gt;earliest=-30d@d index=index  sourcetype=sourcetype | search host=host | stats count as last30days | eval average_reference=(last30days/30/1440*30) | appendcols [ search earliest=-30m latest=now index=index  sourcetype=sourcetype  |  search host=host | stats count as last30minutes ] | eval status = if(last30minutes &amp;gt;= 1.5*average_reference, "Warning", "Normal")&lt;/P&gt;

&lt;P&gt;Any help would be appreciated! &lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 20:08:25 GMT</pubDate>
    <dc:creator>cedmarjls32</dc:creator>
    <dc:date>2020-09-28T20:08:25Z</dc:date>
    <item>
      <title>How to compare number of events during two specific time periods and display status according to result ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-number-of-events-during-two-specific-time-periods/m-p/136936#M37476</link>
      <description>&lt;P&gt;I’d like to compare 1) the number of events received in the last 30 minutes with 2) the average number of events received in the last 30 calendar days (reduced to a 30 minutes span)&lt;/P&gt;

&lt;P&gt;If the result of 1) exceeds by 50% the result of 2), I’d like to have something like “warning”, otherwise “normal”.&lt;/P&gt;

&lt;P&gt;I’ve come up with the following search but it doesn’t seem to be working and I cannot figure out what is wrong with it (I’m pretty sure it’s right under my nose)&lt;/P&gt;

&lt;P&gt;earliest=-30d@d index=index  sourcetype=sourcetype | search host=host | stats count as last30days | eval average_reference=(last30days/30/1440*30) | appendcols [ search earliest=-30m latest=now index=index  sourcetype=sourcetype  |  search host=host | stats count as last30minutes ] | eval status = if(last30minutes &amp;gt;= 1.5*average_reference, "Warning", "Normal")&lt;/P&gt;

&lt;P&gt;Any help would be appreciated! &lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 20:08:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-number-of-events-during-two-specific-time-periods/m-p/136936#M37476</guid>
      <dc:creator>cedmarjls32</dc:creator>
      <dc:date>2020-09-28T20:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare number of events during two specific time periods and display status according to result ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-number-of-events-during-two-specific-time-periods/m-p/136937#M37477</link>
      <description>&lt;P&gt;You have too many &lt;CODE&gt;| search&lt;/CODE&gt;; this works for me:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest=-30d@d index=index sourcetype=sourcetype host=host | stats count as last30days | eval average_reference=(last30days/30/1440*30) | appendcols [ search earliest=-30m latest=now index=index sourcetype=sourcetype | stats count as last30minutes ] | eval status = if(last30minutes &amp;gt;= (1.5*average_reference), "Warning", "Normal")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Jun 2015 14:06:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-number-of-events-during-two-specific-time-periods/m-p/136937#M37477</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-06-05T14:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare number of events during two specific time periods and display status according to result ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-number-of-events-during-two-specific-time-periods/m-p/136938#M37478</link>
      <description>&lt;P&gt;Thanks for your feedback!&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2015 14:34:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-number-of-events-during-two-specific-time-periods/m-p/136938#M37478</guid>
      <dc:creator>cedmarjls32</dc:creator>
      <dc:date>2015-06-05T14:34:43Z</dc:date>
    </item>
  </channel>
</rss>

