# Elastalert not sending email

**URL:** <https://discuss.elastic.co/t/elastalert-not-sending-email/60183>\
**Category:** Elasticsearch\
**Created:** [September 9, 2016, 4:51pm UTC](https://discuss.elastic.co/t/elastalert-not-sending-email/60183 "2016-09-09T16:51:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nkgdhn](https://avatars.discourse-cdn.com/v4/letter/n/bbe5ce/32.png) [@nkgdhn](https://discuss.elastic.co/u/nkgdhn)\
**Post date:** [September 9, 2016, 4:51pm UTC](https://discuss.elastic.co/t/elastalert-not-sending-email/60183/1 "2016-09-09T16:51:41Z")

</div>

Hi Friends need help on elastalert

I wrote one rule for cpu sike alert

* * *

# the monitored Mule CE ESB.

es\_host: elastsearch-hostname  
es\_port: 9200  
name: CPU spike  
type: spike  
index: host\_stats\*

threshold: 1  
timeframe:  
minutes: 1  
spike\_height: 1  
spike\_type: "up"

filter:

- query:  
query\_string:  
query: 'contgroup: "mygroup" AND measure: "ContCpuUsed" AND value: \>1.00'  
#- type:  
#value: "log"  
#doc\_type: "json\_platform\_metrics"

realert:  
minutes: 0  
alert:

- "email"  
email:
- "testing@gmail.com"  
smtp\_host: "[smtp.gmail.com](http://smtp.gmail.com)"  
smtp\_port: 587  
smtp:ssl: true  
from\_addr: "monitoring@gmail.com"  
smtp\_auth\_file: '/opt/elastalert/smtp\_auth\_file.yaml'

* * *

When i am running this :-  
python elastalert.elastalert --verbose --config config.yaml --rule spike.yaml

i am getting this 0 / 0 hits

INFO:elastalert:Queried rule Frequency Alert from 2016-09-08 17:05 UTC to 2016-09-08 17:50 UTC: 0 / 0 hits

But when i am doing elastalert-test-rule spike.yaml  
i am getting below and its showing hits there

INFO:elastalert:Queried rule CPU spike from 2016-09-08 16:43 UTC to 2016-09-08 17:28 UTC: 282 / 84 hits

I am not getting alert email can anyone help me on this regard please

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [September 9, 2016, 5:04pm UTC](https://discuss.elastic.co/t/elastalert-not-sending-email/60183/2 "2016-09-09T17:04:45Z")

</div>

Elastalert is not an Elastic product and is not supported by Elastic in any way.

I would suggest seeking help in the issues section of their repository: [https://github.com/Yelp/elastalert](https://github.com/Yelp/elastalert)

---

<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 5, 2017, 10:21pm UTC](https://discuss.elastic.co/t/elastalert-not-sending-email/60183/3 "2017-07-05T22:21:31Z")

</div>


