Watcher notifications on Slack in Docker env

Hi Team

I am using Docker concept for ELK setup using v7.6.2. I want to configure slack notifications for watcher. Following is my docker-compose.yml file:

version: '3.1'
services:
  es01:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.6.2
    container_name: es01
    environment:
      - node.name=es01
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es02,es03
      - cluster.initial_master_nodes=es01,es02,es03
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
      - xpack.security.enabled=false
      - xpack.graph.enabled=false
      - xpack.watcher.enabled=false
      - xpack.notification.slack.account.monitoring.secure_url=https://hooks.slack.com/services/A/B
      #- xpack.notification.slack.account.monitoring.message.from=watcher
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - data01:/home/abc/docker/elk/elkdata
    ports:
      - 9200:9200
    networks:
      - elastic
  es02:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.6.2
    container_name: es02
    environment:
      - node.name=es02
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es01,es03
      - cluster.initial_master_nodes=es01,es02,es03
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
      - xpack.security.enabled=false
      - xpack.graph.enabled=false
      - xpack.watcher.enabled=false
      - xpack.notification.slack.account.monitoring.secure_url=https://hooks.slack.com/services/A/B/C
      #- xpack.notification.slack.account.monitoring.message.from=watcher
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - data02:/home/abc/docker/elk/elkdata
    networks:
      - elastic
  es03:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.6.2
    container_name: es03
    environment:
      - node.name=es03
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es01,es02
      - cluster.initial_master_nodes=es01,es02,es03
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
      - xpack.security.enabled=false
      - xpack.graph.enabled=false
      - xpack.watcher.enabled=false
      - xpack.notification.slack.account.monitoring.url=https://hooks.slack.com/services/A/B/C
      #- xpack.notification.slack.account.monitoring.message.from=watcher
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - data03:/home/abc/docker/elk/elkdata
    networks:
      - elastic
volumes:
    data01:
        driver: local
    data02:
        driver: local
    data03:
        driver: local
networks:
  elastic:
    driver: bridge

When I do docker-compose up, I am getting following error:

java.lang.IllegalArgumentException: Setting [xpack.notification.slack.account.monitoring.secure_url] is a secure setting and must be stored inside the Elasticsearch keystore, but was found inside elasticsearch.yml
es01 | at org.elasticsearch.common.settings.SecureSetting.get(SecureSetting.java:88)
es01 | at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:565)
es01 | at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:477)
es01 | at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:448)
es01 | at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:419)
es01 | at org.elasticsearch.common.settings.SettingsModule.(SettingsModule.java:149)

Appreciate any help in this.

Regards
Maadhav

1 Like

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