# Elasticsearch enable watcher - email notifications

**URL:** https://discuss.elastic.co/t/elasticsearch-enable-watcher-email-notifications/283794
**Category:** Elasticsearch
**Tags:** elastic-stack-alerting
**Created:** [September 9, 2021, 2:39pm UTC](https://discuss.elastic.co/t/elasticsearch-enable-watcher-email-notifications/283794 "2021-09-09T14:39:03Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![dominbdg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dominbdg/32/102457_2.png) [@dominbdg](https://discuss.elastic.co/u/dominbdg)
#### Post date: [September 9, 2021, 2:39pm UTC](https://discuss.elastic.co/t/elasticsearch-enable-watcher-email-notifications/283794/1 "2021-09-09T14:39:03Z")

</div>

Hello,  
I would like to ask You for help,  
I have one-node elasticsearch with kibana on kubernetes.  
I need to have on kibana watcher email notifications enabled but don't know how to do from elasticsearch yml file.

Right now I have emails option greyed from kibana side with coment "configure elasticsearch.yml"

Can someone help me ?

---

<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: [September 10, 2021, 12:07am UTC](https://discuss.elastic.co/t/elasticsearch-enable-watcher-email-notifications/283794/2 "2021-09-10T00:07:04Z")

</div>

Welcome to our community! 😃

Have you been over [Watcher settings in Elasticsearch | Elasticsearch Guide [7.14] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/notification-settings.html)?

---

<div class="post-metadata">

### Author: ![dominbdg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dominbdg/32/102457_2.png) [@dominbdg](https://discuss.elastic.co/u/dominbdg)
#### Post date: [September 10, 2021, 9:43am UTC](https://discuss.elastic.co/t/elasticsearch-enable-watcher-email-notifications/283794/3 "2021-09-10T09:43:00Z")

</div>

hello, warkolm  
thanks for reply, yes I saw this website but have small question,  
as I uderstand this section :

```auto
"actions" : {
  "send_email" : { 
    "email" : { 
      "to" : "username@example.org", 
      "subject" : "Watcher Notification", 
      "body" : "{{ctx.payload.hits.total}} error logs found" 
    }
  }
}

```

should be only included in elasticsearch.yml and  
xpack.watcher.enabled yes ?

I have on kibana also 4 spaces - how can I set options only for one space ?

---

<div class="post-metadata">

### Author: ![dominbdg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dominbdg/32/102457_2.png) [@dominbdg](https://discuss.elastic.co/u/dominbdg)
#### Post date: [September 10, 2021, 10:20pm UTC](https://discuss.elastic.co/t/elasticsearch-enable-watcher-email-notifications/283794/4 "2021-09-10T22:20:12Z")

</div>

Can someone help me with this email notifications from elasticsearch yml file ?  
I addedd section in elasticsearch yml file

```auto
xpack.watcher.enabled: true
xpack.notification.email.account:
  gmail_account:
    profile: gmail
      smtp:
        auth: true
        starttls.enable: true
        host: smtp.gmail.com
        port: 587
        user: dominbdg

```

but the problem is that - elasticsearch don't want to start with this configuration.  
when - from documentation try to launch :

```auto
bin/elasticsearch-keystore add xpack.notification.email.account.gmail_account.smtp.secure_password

```

I'm getting error:

```auto
Caused by: com.fasterxml.jackson.dataformat.yaml.snakeyaml.error.MarkedYAMLException: mapping values are not allowed here
 in 'reader', line 87, column 11:
          smtp:

```

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [September 10, 2021, 11:10pm UTC](https://discuss.elastic.co/t/elasticsearch-enable-watcher-email-notifications/283794/5 "2021-09-10T23:10:36Z")

</div>

Most likely You have a yml syntax / formatting error in that section.. either in it or after it.. that's what the error indicates.

---

<div class="post-metadata">

### Author: ![dominbdg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dominbdg/32/102457_2.png) [@dominbdg](https://discuss.elastic.co/u/dominbdg)
#### Post date: [September 10, 2021, 11:13pm UTC](https://discuss.elastic.co/t/elasticsearch-enable-watcher-email-notifications/283794/6 "2021-09-10T23:13:56Z")

</div>

@stephenb  
Thanks for that - You were right - there was an improper formatting.

---

<div class="post-metadata">

### Author: ![dominbdg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dominbdg/32/102457_2.png) [@dominbdg](https://discuss.elastic.co/u/dominbdg)
#### Post date: [September 10, 2021, 11:23pm UTC](https://discuss.elastic.co/t/elasticsearch-enable-watcher-email-notifications/283794/7 "2021-09-10T23:23:05Z")

</div>

I have also a question - we have local openrelay in my company. Is it possible to use it or I have to have regular mail account for watcher emails ?

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [September 10, 2021, 11:52pm UTC](https://discuss.elastic.co/t/elasticsearch-enable-watcher-email-notifications/283794/8 "2021-09-10T23:52:44Z")

</div>

I don't know... Try it 😉

It expects an SMTP endpoint.

---

<div class="post-metadata">

### Author: ![dominbdg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dominbdg/32/102457_2.png) [@dominbdg](https://discuss.elastic.co/u/dominbdg)
#### Post date: [September 12, 2021, 6:13pm UTC](https://discuss.elastic.co/t/elasticsearch-enable-watcher-email-notifications/283794/9 "2021-09-12T18:13:02Z")

</div>

@stephenb - You are right - using normal email server works.  
I have a small question - when I need to use ssl - how to do it ?  
I have below configuration:

```auto
xpack.notification.email.account:
    gmail_account:
        profile: gmail
        smtp:
            auth: true
            starttls.enable: true
            host: smtp.gmail.com
            port: 587
            user: <username>

```

is it possible that instead of starttls.enable I can use ssl.enable and change port to ssl ?

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [September 12, 2021, 6:30pm UTC](https://discuss.elastic.co/t/elasticsearch-enable-watcher-email-notifications/283794/10 "2021-09-12T18:30:02Z")

</div>

I do not see `ssl.enable` as a valid option in the docs. Perhaps just set to the ssl port and try it.

In the docs [here](https://www.elastic.co/guide/en/elasticsearch/reference/7.14/notification-settings.html#email-notification-settings)

If it is a self signed certificate you may need to add additional settings

Curious why not use

`starttls.enable: true`

---

<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: [October 10, 2021, 6:30pm UTC](https://discuss.elastic.co/t/elasticsearch-enable-watcher-email-notifications/283794/11 "2021-10-10T18:30:30Z")

</div>

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