# Throttle filter sends 3x e-mails

**URL:** <https://discuss.elastic.co/t/throttle-filter-sends-3x-e-mails/39468>\
**Category:** Logstash\
**Created:** [January 18, 2016, 4:24pm UTC](https://discuss.elastic.co/t/throttle-filter-sends-3x-e-mails/39468 "2016-01-18T16:24:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcmga](https://avatars.discourse-cdn.com/v4/letter/m/3bc359/32.png) [@marcmga](https://discuss.elastic.co/u/marcmga)\
**Post date:** [January 18, 2016, 4:24pm UTC](https://discuss.elastic.co/t/throttle-filter-sends-3x-e-mails/39468/1 "2016-01-18T16:24:50Z")

</div>

Hi,

I've created a filter to throttle issolatelly messages from several servers. When the systems receives 50 equal messages from an specific server i add a tag "e-mail".  
Output sends e-mail when a message have this tag. However, It send 3 e-mails insted of sending one.

I don't why, is there something wrong in my config?

> throttle {  
> before\_count =\> 24  
> after\_count =\> 26  
> period =\> 300  
> key =\> "[%{host}][ws\_bingobombo]"  
> add\_tag =\> "error\_ws\_bingobombo"  
> }  
> if "error\_ws\_bingobombo" not in [tags] {  
> mutate {  
> add\_tag =\> ["email\_ws\_social\_error"]  
> }  
> }

Thanks

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 18, 2016, 10:56pm UTC](https://discuss.elastic.co/t/throttle-filter-sends-3x-e-mails/39468/2 "2016-01-18T22:56:52Z")

</div>

And what do your outputs look like?

---

<div class="post-metadata">

**Author:** ![marcmga](https://avatars.discourse-cdn.com/v4/letter/m/3bc359/32.png) [@marcmga](https://discuss.elastic.co/u/marcmga)\
**Post date:** [January 19, 2016, 8:14am UTC](https://discuss.elastic.co/t/throttle-filter-sends-3x-e-mails/39468/3 "2016-01-19T08:14:11Z")

</div>

Hi warkolm,

> if "email\_ws\_social\_error" in [tags] {  
> email {  
> to =\> "addresses"  
> address =\> "my server ip"  
> body =\> "Error ... [HOST:%{host}]--[TIME:%{time}]"  
> domain =\> "my domain"  
> from =\> "[servidor.logs@domain.com](mailto:servidor.logs@domain.com)"  
> subject =\> "[%{host}] - Error"  
> via =\> "smtp"  
> }  
> }

I don't understand why is sending 3 e-mail, within the same time (2 seconds between them)

---

<div class="post-metadata">

**Author:** ![Kishore](https://avatars.discourse-cdn.com/v4/letter/k/8edcca/32.png) [@Kishore](https://discuss.elastic.co/u/Kishore)\
**Post date:** [January 19, 2016, 10:51am UTC](https://discuss.elastic.co/t/throttle-filter-sends-3x-e-mails/39468/4 "2016-01-19T10:51:34Z")

</div>

Hi Marc,

Throttle condition which you had written is not throttling 24th, 25th and 26th events, therefore as per your condition if "error\_ws\_bingobombo" not in [tags] it will generate 3 email alerts for those three events.

If you wish to generate single alert change count as before\_count =\> 24, after\_count =\> 24.

---

<div class="post-metadata">

**Author:** ![marcmga](https://avatars.discourse-cdn.com/v4/letter/m/3bc359/32.png) [@marcmga](https://discuss.elastic.co/u/marcmga)\
**Post date:** [January 19, 2016, 10:54am UTC](https://discuss.elastic.co/t/throttle-filter-sends-3x-e-mails/39468/5 "2016-01-19T10:54:43Z")

</div>

Hi Kishore909,

I've cheked documentation and you are right, it doesn't throttle events 24 and 26... i didn't realized.

Thank you

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 5:15am UTC](https://discuss.elastic.co/t/throttle-filter-sends-3x-e-mails/39468/6 "2017-07-06T05:15:15Z")

</div>


