<?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 count the number of the occurrences / buckets when the given event happened? in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/How-do-I-count-the-number-of-the-occurrences-buckets-when-the/m-p/396152#M6981</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/138512"&gt;@damucka&lt;/a&gt;&lt;/P&gt;

&lt;P&gt;try this: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=mlbso sourcetype=BWP_hanatraces "Out of memory for Pool/JoinEvaluator" earliest=-30m
| bin _time span=1m 
| stats count AS OOM_Pool by _time
| eval occurrence=if(OOM_Pool!=0, 1, 0)
| stats count as occurrences_in_last_30_min
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then alert if occurrences_in_last_30_min is &amp;gt;5&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 21:25:03 GMT</pubDate>
    <dc:creator>darrenfuller</dc:creator>
    <dc:date>2020-09-29T21:25:03Z</dc:date>
    <item>
      <title>How do I count the number of the occurrences / buckets when the given event happened?</title>
      <link>https://community.splunk.com/t5/Alerting/How-do-I-count-the-number-of-the-occurrences-buckets-when-the/m-p/396151#M6980</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am trying to count the time buckets when the specific search returns values and alert on it. My current search looks as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=mlbso sourcetype=BWP_hanatraces "Out of memory for Pool/JoinEvaluator" | timechart count span=1m as OOM_Pool | eval Occurence = if (OOM_Pool &amp;gt; 0,1,0)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For alerting, I am only interested in the occurrence being 1 or 0, not in the number of events (count) per time bucket. Then, I want to alert when the Occurrences increase with time, which I set in the alert trigger options (&amp;gt; 5 in the last 30 minutes).&lt;/P&gt;

&lt;P&gt;The problem is that this is not working and the alert takes not only the Occurrence but also a Count and adds both up. So if I have the 25 events (OOM_Pool) in one minute, then the Occurrence is 1, Count 25 and the alert gets triggered. I tried to overcome this by setting the Custom triggering condition condition:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search Occurence &amp;gt; 5"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but this does not seem to work. &lt;/P&gt;

&lt;P&gt;How would I do it properly?&lt;/P&gt;

&lt;P&gt;Kind regards,&lt;BR /&gt;
Kamil&lt;/P&gt;</description>
      <pubDate>Mon, 01 Oct 2018 15:02:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-do-I-count-the-number-of-the-occurrences-buckets-when-the/m-p/396151#M6980</guid>
      <dc:creator>damucka</dc:creator>
      <dc:date>2018-10-01T15:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: How do I count the number of the occurrences / buckets when the given event happened?</title>
      <link>https://community.splunk.com/t5/Alerting/How-do-I-count-the-number-of-the-occurrences-buckets-when-the/m-p/396152#M6981</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/138512"&gt;@damucka&lt;/a&gt;&lt;/P&gt;

&lt;P&gt;try this: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=mlbso sourcetype=BWP_hanatraces "Out of memory for Pool/JoinEvaluator" earliest=-30m
| bin _time span=1m 
| stats count AS OOM_Pool by _time
| eval occurrence=if(OOM_Pool!=0, 1, 0)
| stats count as occurrences_in_last_30_min
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then alert if occurrences_in_last_30_min is &amp;gt;5&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:25:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-do-I-count-the-number-of-the-occurrences-buckets-when-the/m-p/396152#M6981</guid>
      <dc:creator>darrenfuller</dc:creator>
      <dc:date>2020-09-29T21:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do I count the number of the occurrences / buckets when the given event happened?</title>
      <link>https://community.splunk.com/t5/Alerting/How-do-I-count-the-number-of-the-occurrences-buckets-when-the/m-p/396153#M6982</link>
      <description>&lt;P&gt;hi @damucka&lt;/P&gt;

&lt;P&gt;Did the answer below solve your problem? If so, please resolve this post by approving it! &lt;BR /&gt;
If your problem is still not solved, keep us updated so that someone else can help ya. Thanks for posting!&lt;/P&gt;</description>
      <pubDate>Mon, 01 Oct 2018 21:33:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-do-I-count-the-number-of-the-occurrences-buckets-when-the/m-p/396153#M6982</guid>
      <dc:creator>mstjohn_splunk</dc:creator>
      <dc:date>2018-10-01T21:33:53Z</dc:date>
    </item>
  </channel>
</rss>

