Hello,
I have been trying to send x-pack slack notification but keep failing - i amnot sure what wrong I am doing here ... below is my x-pack slack configuration in elasticsearch.yml file. Kindly Help me to troubleshoot and setup email slack notification.
==========================
#Xpack
action.auto_create_index: .security,.monitoring*,.watches,.triggered_watches,.watcher-history*
xpack.notification.slack.default_account:
url: https://hooks.slack.com/services/dhw65jnduedu/08hbdhyj092hLhjpedko/
message_defaults:
from: watcher
watcher.actions.email.service.account:
standard_account:
profile: standard
smtp:
host: mta41r1.sl.emptoris.com
port: 25
"actions": {
"email_administrator": {
"email": {
"from": "admin@123.com",
"to": "admin@123-engage.slack.com",
"subject": "Counts of error code is {{ctx.payload.hits.total}}",
"body": "There are total {{401 Unauthorized}} error codes found at {{ctx.execution_time}}",
"priority": "high"
}
}
}
xpack.watcher.index.rest.direct_access: true
http.cors.enabled: true
http.cors.allow-origin: http://localhost:5601
xpack.watcher.execution.default_throttle_period: 10m
script.engine.groovy.inline.elasticsearch-watcher-watch: on
"actions": {
"my_webhook": {
"throttle_period": "2m",
"webhook": {
"method": "POST",
"host": "localhost",
"port": 9200,
"path": ":/{{ctx.watch_id}",
"body": "{{ctx.watch_id}}:{{ctx.payload.hits.total}}"
}
}
}
==========================
Thanks,
Sandeep