-1

We have docker based elasticsearch cluster for multi-nodes architecture. We provide elasticsearch config as environment variables for respective nodes in docker-compose.yml. We are not using elasticsearch.yml as config file inside docker-compose file.

We need to implement slack notification as elasticsearch watcher alerts. Using following inside elasticsearch.yml, we can enable slack notification:

xpack.notification.slack:   account:
    monitoring:
      url: <WEB-HOOK-URL>
      message_defaults:
        from: x-pack
        icon: http://example.com/images/watcher-icon.jpg
        attachment:
          fallback: "X-Pack Notification"
          color: "#36a64f"
          title: "X-Pack Notification"
          title_link: "https://www.elastic.co/guide/en/x-pack/current/index.html"
          text: "One of your watches generated this notification."
          mrkdwn_in: "pretext, text"

The question is, this above config is compatible with elasticsearch.yml, what is its equivalent config using docker-compose.yml without using elasticsearch.yml ?

Mohit Shah
  • 124
  • 7
  • Why not just bind-mount an `elasticsearch.yml` into your container? – larsks May 12 '20 at 12:00
  • @larsks: Thanks for reply. The current implementation is without bind-mount elasticsearch.yml. So need to get solution compatible with current implementation only. – Mohit Shah May 13 '20 at 05:32

1 Answers1

0

These config should be given as follows:

xpack.notification.slack.account.monitoring.url: <WEB-HOOK-URL>
xpack.notification.slack.account.monitoring.message_defaults.from: x-pack

docker-compose.yml accepts these config as env config.

Mohit Shah
  • 124
  • 7