# Email notification on ERROR in log

**URL:** https://discuss.elastic.co/t/email-notification-on-error-in-log/20196
**Category:** Elasticsearch
**Created:** [October 11, 2014, 6:49am UTC](https://discuss.elastic.co/t/email-notification-on-error-in-log/20196 "2014-10-11T06:49:26Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Prasad\_Lele](https://avatars.discourse-cdn.com/v4/letter/p/c67d28/32.png) [@Prasad\_Lele](https://discuss.elastic.co/u/Prasad_Lele)
#### Post date: [October 11, 2014, 6:49am UTC](https://discuss.elastic.co/t/email-notification-on-error-in-log/20196/1 "2014-10-11T06:49:26Z")

</div>

Hi frnds,

I have configured, Logstash + redis + indexer + elasticsearch + kibana in  
mysetup for logcollection. Using beaver + rsyslog agent to pushlogs to the  
logstash. The logs are being collected successfully. What I want to setup  
now if the email based alert.

My requirement was If any specific exceptions a JDBC or OutOfMemory  
exception for example, an email should be triggered to my emailid.  
To achieve that tried multiple options like filter at logstash/indexer  
level, shell script to pull from elasticsearch via json query. The filter  
option in logstash did not work.

The shell script option worked and I was able to get email with the data  
from elasticsearch, however the filter in the json script did not work  
somehow and it used to send me the data for entire day(index) rather than  
the last 5 minutes.

Not sure if anyone has already tried this and or is this discussed already.

Can anyone help me here. Thanks in advance.

Regards  
Prasad Lele

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/20fed4be-eab1-4cb7-8867-44edce8ba3c6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/20fed4be-eab1-4cb7-8867-44edce8ba3c6%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)
#### Post date: [October 11, 2014, 7:03am UTC](https://discuss.elastic.co/t/email-notification-on-error-in-log/20196/2 "2014-10-11T07:03:53Z")

</div>

Have you tried log4j SMTP appender?

Regarding JDBC exception, I will add a documentation how to set up log4j2

[http://logging.apache.org/log4j/2.0/manual/appenders.html#SMTPAppender](http://logging.apache.org/log4j/2.0/manual/appenders.html#SMTPAppender)

in the next version of JDBC river/plugin.

Jörg

On Sat, Oct 11, 2014 at 8:49 AM, Prasad Lele [prasad.lele85@gmail.com](mailto:prasad.lele85@gmail.com)  
wrote:

> Hi frnds,
> 
> I have configured, Logstash + redis + indexer + elasticsearch + kibana in  
> mysetup for logcollection. Using beaver + rsyslog agent to pushlogs to the  
> logstash. The logs are being collected successfully. What I want to setup  
> now if the email based alert.
> 
> My requirement was If any specific exceptions a JDBC or OutOfMemory  
> exception for example, an email should be triggered to my emailid.  
> To achieve that tried multiple options like filter at logstash/indexer  
> level, shell script to pull from elasticsearch via json query. The filter  
> option in logstash did not work.
> 
> The shell script option worked and I was able to get email with the data  
> from elasticsearch, however the filter in the json script did not work  
> somehow and it used to send me the data for entire day(index) rather than  
> the last 5 minutes.
> 
> Not sure if anyone has already tried this and or is this discussed  
> already.
> 
> Can anyone help me here. Thanks in advance.
> 
> Regards  
> Prasad Lele
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/20fed4be-eab1-4cb7-8867-44edce8ba3c6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/20fed4be-eab1-4cb7-8867-44edce8ba3c6%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/20fed4be-eab1-4cb7-8867-44edce8ba3c6%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/20fed4be-eab1-4cb7-8867-44edce8ba3c6%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFX2cKQjjDagzAvgpPv3U7aS7KFwsxm8KLxshHJ%2Bcx5QA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFX2cKQjjDagzAvgpPv3U7aS7KFwsxm8KLxshHJ%2Bcx5QA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:56am UTC](https://discuss.elastic.co/t/email-notification-on-error-in-log/20196/3 "2017-07-06T00:56:54Z")

</div>


