# Logstash Email Output

**URL:** <https://discuss.elastic.co/t/logstash-email-output/192770>\
**Category:** Logstash\
**Created:** [July 29, 2019, 8:12pm UTC](https://discuss.elastic.co/t/logstash-email-output/192770 "2019-07-29T20:12:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![userR](https://avatars.discourse-cdn.com/v4/letter/u/22d042/32.png) [@userR](https://discuss.elastic.co/u/userR)\
**Post date:** [July 29, 2019, 8:12pm UTC](https://discuss.elastic.co/t/logstash-email-output/192770/1 "2019-07-29T20:12:56Z")

</div>

Hi,

I am wondering how to configure an email output for Outlook. In my current logstash configuration, I have the following code:

```
output {
  elasticsearch {
    hosts => "localhost:9200"
    index => "somename"
  }
  if "Error" in [message]
     email {
       to=> 'email@somemail.com'
       from => 'email@anotheremail.com'
       subject => 'ALERT: Error in Logs'
       body => "Tags: %{tag}\\n\\Information:\\n%{message}"
     }
  }
  stdout{}
}

```

I see [here](https://www.elastic.co/guide/en/elastic-stack-overview/6.3/actions-email.html#outlook) that I will need to configure the SMTP in elasticsearch.yml. My question is: Is that all the required info to send an email when a log contains error? Also, is xpack.notifcations included in the default subscription?

---

<div class="post-metadata">

**Author:** ![guyboertje](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guyboertje/32/31592_2.png) [@guyboertje](https://discuss.elastic.co/u/guyboertje)\
**Post date:** [July 30, 2019, 3:40pm UTC](https://discuss.elastic.co/t/logstash-email-output/192770/2 "2019-07-30T15:40:28Z")

</div>

The plugin starts a SMTP conversation with a SMTP server. If the server is not running locally (on localhost) you need to provide an `address` setting. The examples omit this because a local SMTP server listening on port 25 is assumed.

---

<div class="post-metadata">

**Author:** ![userR](https://avatars.discourse-cdn.com/v4/letter/u/22d042/32.png) [@userR](https://discuss.elastic.co/u/userR)\
**Post date:** [July 30, 2019, 5:50pm UTC](https://discuss.elastic.co/t/logstash-email-output/192770/3 "2019-07-30T17:50:40Z")

</div>

Just to be clear, I won't be able to configure this with a regular subscription correct? I do not have alerting currently and I believe notifications is part of that package.

---

<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:** [August 27, 2019, 5:50pm UTC](https://discuss.elastic.co/t/logstash-email-output/192770/4 "2019-08-27T17:50:49Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
