# Need help in configuring email alert in logstash 1.5.4

**URL:** <https://discuss.elastic.co/t/need-help-in-configuring-email-alert-in-logstash-1-5-4/28508>\
**Category:** Logstash\
**Created:** [September 2, 2015, 9:57am UTC](https://discuss.elastic.co/t/need-help-in-configuring-email-alert-in-logstash-1-5-4/28508 "2015-09-02T09:57:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![asgawali](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@asgawali](https://discuss.elastic.co/u/asgawali)\
**Post date:** [September 2, 2015, 9:57am UTC](https://discuss.elastic.co/t/need-help-in-configuring-email-alert-in-logstash-1-5-4/28508/1 "2015-09-02T09:57:52Z")

</div>

Hi,

I was using logstash 1.4.2 and this email alert was working fine at that time. Now my system is upgraded to logstash 1.5.4 and logstash is failing because of older settings as below:

```
email { 
        from => "{{Mailfrom}}" 
        match => ["ERROR ALERT", "LOGLEVEL,ERROR"]   
        subject => "%{matchName}" 
        to => "{{Rcptto}}" 
        via => "smtp" 
        htmlbody => "<h2>%{matchName}</h2><br/><br/><div   
        align='center'>%{message}</div>" 
        options => [ 
               "smtpIporHost", "{{smtpIporHost}}", 
               "port", "{{smtpPort}}", 
               "domain", "{{mailDomain}}", 
               "userName", "{{Mailfrom}}", 
               "password", "{{MailFromPassword}}", 
               "authenticationType", "plain", 
               "starttls", "true" 
       ]
}

```

Now I am getting error as `"You are using a deprecated config setting \"match\" set in email. Deprecated settings will continue to work, but are scheduled for removal from logstash in the future. If you have any questions about this, please visit the #logstash channel on freenode irc."`

Can anyone help me here, as how should i configure it according to ERROR condition in 1.5.4?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [September 2, 2015, 1:04pm UTC](https://discuss.elastic.co/t/need-help-in-configuring-email-alert-in-logstash-1-5-4/28508/2 "2015-09-02T13:04:41Z")

</div>

I don't know what `match => ["ERROR ALERT", "LOGLEVEL,ERROR"]` actually means, but you'll want to use a conditional, perhaps something like this:

```
if [ERROR ALERT] == "LOGLEVEL,ERROR" {
  email {
    ...
  }
}
```

---

<div class="post-metadata">

**Author:** ![asgawali](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@asgawali](https://discuss.elastic.co/u/asgawali)\
**Post date:** [September 4, 2015, 5:46am UTC](https://discuss.elastic.co/t/need-help-in-configuring-email-alert-in-logstash-1-5-4/28508/3 "2015-09-04T05:46:53Z")

</div>

Figured out, how to handle it. I applied it in following way and it worked.

```
if "Erro" in [severity] {
email {
        from => "someone@somedomain.com"
        subject => "Error Alert"
        to => "someone@somedomain.com"
        via => "smtp"
        htmlbody => "<h2>Error Alert1</h2><br/><br/><div
        align='center'>%{message}</div>"
        options => [
               "smtpIporHost", "smtp.office365.com",
               "port", "587",
               "domain", "smtp.office365.com",
               "userName", "someone@somedomain.com",
               "password", "somepasswd",
               "authenticationType", "login",
               "starttls", "true"
       ]
}
}

```

Hope this can be useful to anyone in future.

---

<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:30am UTC](https://discuss.elastic.co/t/need-help-in-configuring-email-alert-in-logstash-1-5-4/28508/4 "2017-07-06T05:30:09Z")

</div>


