Of course, this was just a representative example of using watcher to hit an HTTP endpoint and format the results. If you want to change the endpoint, then just do that. If you don't want to format the results, you can remove the transform
sections. The bare-bones example of this would look something like:
POST _watcher/watch/_execute
{
"watch": {
"trigger": {
"schedule": {
"interval": "1d"
}
},
"input": {
"http": {
"request": {
"host": "mycluster-name.es.us-central1.gcp.cloud.es.io",
"port": 9243,
"scheme": "https",
"path": "/_cat/indices",
"params": {
"format": "json",
"bytes": "b",
"human": "true"
},
"headers": {},
"auth": {
"basic": {
"username": "elastic",
"password": "xxx"
}
}
}
}
},
"condition": {
"script": "return true;"
},
"actions": {
"displayResults": {
"logging": {
"text": "the output is: {{ctx.payload}}"
}
}
}
}
}
And the unformatted output would look something like:
"the output is: {_headers={content-type=[application/json], x-found-handling-cluster=[71bbfab0891a4b02acf6c5a5ff286fd9], x-cloud-request-id=[tPrexYvzRdigrVx5hg3gOw], x-elastic-product=[Elasticsearch], date=[Wed, 21 Sep 2022 13:59:42 GMT], x-found-handling-instance=[instance-0000000000]}, data=[{health=green, status=open, index=kibana_sample_data_logs, uuid=iJw6Xf-JQ5mu_vXPge3y2A, pri=1, rep=0, docs.count=14074, docs.deleted=0, store.size=8778892, pri.store.size=8778892}, {health=yellow, status=open, index=kibana_sample_data_logs_rollup, uuid=b3LG3Gy7Sdm07MyGn1uEbA, pri=1, rep=1, docs.count=1912, docs.deleted=0, store.size=659460, pri.store.size=659460}], _status_code=200}"