<?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: Alert if number of events by user is doubled by the average of last month of the same user in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Alert-if-number-of-events-by-user-is-doubled-by-the-average-of/m-p/279959#M5163</link>
    <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=outgoing earliest=-30d@d | bin span=1d _time | eventstats count as daily_ct by user _time | where _time&amp;gt;=relative_time(now(), "@d") | stats count avg(daily_ct ) as user_avg by user | where count&amp;gt;= user_avg*2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 29 Jul 2016 15:49:41 GMT</pubDate>
    <dc:creator>sundareshr</dc:creator>
    <dc:date>2016-07-29T15:49:41Z</dc:date>
    <item>
      <title>Alert if number of events by user is doubled by the average of last month of the same user</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-if-number-of-events-by-user-is-doubled-by-the-average-of/m-p/279954#M5158</link>
      <description>&lt;P&gt;I have a search that returns the number of events of every user (count by user).&lt;BR /&gt;
I'd like to generate an alert if the number of events in one day is the double of the average of events generated in the last month by this user. It should apply to every user &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2016 15:02:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-if-number-of-events-by-user-is-doubled-by-the-average-of/m-p/279954#M5158</guid>
      <dc:creator>gutter</dc:creator>
      <dc:date>2016-07-25T15:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: Alert if number of events by user is doubled by the average of last month of the same user</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-if-number-of-events-by-user-is-doubled-by-the-average-of/m-p/279955#M5159</link>
      <description>&lt;P&gt;Try this. Set your alert if &lt;CODE&gt;count&amp;gt;0&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=yourindexname sourcetype=yoursourcetype earliest=-30d@d | eventstats avg(count) as month_avg by user | where _time&amp;gt;=relative_time(now(), "@d") | stats count max(month_avg) as user_avg by user | where count&amp;gt;= user_avg*2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Jul 2016 17:11:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-if-number-of-events-by-user-is-doubled-by-the-average-of/m-p/279955#M5159</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-07-25T17:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: Alert if number of events by user is doubled by the average of last month of the same user</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-if-number-of-events-by-user-is-doubled-by-the-average-of/m-p/279956#M5160</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search (earliest=-1mon@mon latest=@mon) OR (earliest=@d latest=now) | eval period=if(_time&amp;lt;relative_time(now(),"@mon"),"LastMon","Today") | bucket span=1d _time | stats count by user type _time | chart avg(count) over user by type | where LastMon*2&amp;lt;Today
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Jul 2016 17:20:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-if-number-of-events-by-user-is-doubled-by-the-average-of/m-p/279956#M5160</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-07-25T17:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: Alert if number of events by user is doubled by the average of last month of the same user</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-if-number-of-events-by-user-is-doubled-by-the-average-of/m-p/279957#M5161</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;Thanks for the answers, but seems it doesn't work or i'm missing something, the search return 0 events:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=outgoing earliest=-30d@d | eventstats avg(count) as month_avg by user | where _time&amp;gt;=relative_time(now(), "@d") | stats count max(month_avg) as user_avg by user | where count&amp;gt;= user_avg*2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I tried also first to display only the average events for one specific user, with the following search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=outgoing earliest=-30d@d | eventstats avg(count) as month_avg by user
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But I'm not able to see this average value anywhere (as a field or in statistics, etc.)&lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2016 13:16:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-if-number-of-events-by-user-is-doubled-by-the-average-of/m-p/279957#M5161</guid>
      <dc:creator>gutter</dc:creator>
      <dc:date>2016-07-29T13:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: Alert if number of events by user is doubled by the average of last month of the same user</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-if-number-of-events-by-user-is-doubled-by-the-average-of/m-p/279958#M5162</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;Thanks for the answers, but seems it doesn't work or i'm missing something, the search return 0 events:&lt;/P&gt;

&lt;P&gt;eventtype=outgoing earliest=-30d@d | eventstats avg(count) as month_avg by user | where _time&amp;gt;=relative_time(now(), "@d") | stats count max(month_avg) as user_avg by user | where count&amp;gt;= user_avg*2&lt;/P&gt;

&lt;P&gt;I tried also first to display only the average events for one specific user, with the following search:&lt;/P&gt;

&lt;P&gt;eventtype=outgoing earliest=-30d@d | eventstats avg(count) as month_avg by user&lt;/P&gt;

&lt;P&gt;But I'm not able to see this average value anywhere (as a field or in statistics, etc.)&lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:26:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-if-number-of-events-by-user-is-doubled-by-the-average-of/m-p/279958#M5162</guid>
      <dc:creator>gutter</dc:creator>
      <dc:date>2020-09-29T10:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: Alert if number of events by user is doubled by the average of last month of the same user</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-if-number-of-events-by-user-is-doubled-by-the-average-of/m-p/279959#M5163</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=outgoing earliest=-30d@d | bin span=1d _time | eventstats count as daily_ct by user _time | where _time&amp;gt;=relative_time(now(), "@d") | stats count avg(daily_ct ) as user_avg by user | where count&amp;gt;= user_avg*2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Jul 2016 15:49:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-if-number-of-events-by-user-is-doubled-by-the-average-of/m-p/279959#M5163</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-07-29T15:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: Alert if number of events by user is doubled by the average of last month of the same user</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-if-number-of-events-by-user-is-doubled-by-the-average-of/m-p/279960#M5164</link>
      <description>&lt;P&gt;Apologies @sundareshr @gutter if you got a notification that the answer was accepted. I accidentally clicked "Accept", but was going to edit the search formatting in the comment. &lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2016 19:55:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-if-number-of-events-by-user-is-doubled-by-the-average-of/m-p/279960#M5164</guid>
      <dc:creator>ppablo</dc:creator>
      <dc:date>2016-08-04T19:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: Alert if number of events by user is doubled by the average of last month of the same user</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-if-number-of-events-by-user-is-doubled-by-the-average-of/m-p/279961#M5165</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;I've tried with this search, for example:&lt;/P&gt;

&lt;P&gt;eventtype=outgoing earliest=-120d@d | stats count as diary by date_mday,Remitent| stats avg(diary) as average_diary by Remitent where diary&amp;gt;2*average_diary&lt;/P&gt;

&lt;P&gt;but if gives no results, where it should return...&lt;/P&gt;

&lt;P&gt;This query: eventtype=outgoing earliest=-120d@d | stats count as diary by date_mday,Remitent&lt;BR /&gt;
 returns all the events for every user by every day&lt;/P&gt;

&lt;P&gt;And this query: eventtype=outgoing earliest=-120d@d | stats count as diary by date_mday,Remitent| stats avg(diary) as median_diary by Remitent  returns the average by every user.&lt;/P&gt;

&lt;P&gt;Now, when I put the "where" condition, it returns 0 events (it should return some...)&lt;/P&gt;

&lt;P&gt;What I'm missing?...&lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:41:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-if-number-of-events-by-user-is-doubled-by-the-average-of/m-p/279961#M5165</guid>
      <dc:creator>gutter</dc:creator>
      <dc:date>2020-09-29T10:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Alert if number of events by user is doubled by the average of last month of the same user</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-if-number-of-events-by-user-is-doubled-by-the-average-of/m-p/279962#M5166</link>
      <description>&lt;P&gt;My bad. Try thsi updated query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=outgoing earliest=-30d@d | bin span=1mon _time | eventstats count as month_cnt by _time user | eventstats avg(month_cnt) as month_avg by _time user | where _time&amp;gt;=relative_time(now(), "@d") | stats count max(month_avg) as user_avg by user | where count&amp;gt;= user_avg*2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Aug 2016 13:35:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-if-number-of-events-by-user-is-doubled-by-the-average-of/m-p/279962#M5166</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-08-16T13:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: Alert if number of events by user is doubled by the average of last month of the same user</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-if-number-of-events-by-user-is-doubled-by-the-average-of/m-p/279963#M5167</link>
      <description>&lt;P&gt;Hi sundareshr, &lt;/P&gt;

&lt;P&gt;It works, but without the "where _time&amp;gt;=relative_time(now(), "@d")" condition...&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:39:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-if-number-of-events-by-user-is-doubled-by-the-average-of/m-p/279963#M5167</guid>
      <dc:creator>gutter</dc:creator>
      <dc:date>2020-09-29T10:39:15Z</dc:date>
    </item>
  </channel>
</rss>

