I'm trying to setup a watcher to display indices health using the endpoint mentioned but keep getting a 405 error.
This error goes away when I just use the following /_cluster/health
dropping the params ?level=indices
, I'm not sure what I'm doing wrong as the endpoint is a GET endpoint.
Incorrect HTTP method for uri [/_cluster/health%3Flevel=indices] and method [GET], allowed: [POST]
PUT _xpack/watcher/watch/cluster_healthcheck_not_green
{
"trigger" : {
"schedule" : { "interval" : "10s" }
},
"input" : {
"http" : {
"request" : {
"scheme": "https",
"host" : "....eu-west-1.aws.found.io",
"port" : 9243,
"path" : "/_cluster/health?level=indices",
"auth": {
"basic": {
"username": "...",
"password": "..."
}
}
}
}
},
"condition" : {
"compare" : {
"ctx.payload.status" : { "not_eq" : "green" }
}
},
"actions": {
"notify-slack": {
"throttle_period" : "5m",
"slack" : {
"message" : {
"to" : [ "#elasticsearch-alerts-test" ],
"text" : "Cluster health should be \"green\""
}
}
}
}
}