IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Update Watcher index settings
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
Update Watcher index settings
editThis API allows a user to modify the settings for the Watcher internal index (.watches). Only a subset of settings
are allowed to be modified. This includes:
-
index.auto_expand_replicas -
index.number_of_replicas -
Any setting with the prefix
index.routing.allocation.exclude. -
Any setting with the prefix
index.routing.allocation.include. -
Any setting with the prefix
index.routing.allocation.require.
Modification of index.routing.allocation.include._tier_preference is an exception and is not allowed as the Watcher
shards must always be in the data_content tier.
An example of modifying the Watcher settings:
resp = client.watcher.put_watch(
id="test_watch",
trigger={
"schedule": {
"hourly": {
"minute": [
0,
5
]
}
}
},
input={
"simple": {
"payload": {
"send": "yes"
}
}
},
condition={
"always": {}
},
)
print(resp)
const response = await client.watcher.putWatch({
id: "test_watch",
trigger: {
schedule: {
hourly: {
minute: [0, 5],
},
},
},
input: {
simple: {
payload: {
send: "yes",
},
},
},
condition: {
always: {},
},
});
console.log(response);
PUT /_watcher/watch/test_watch
{
"trigger": {
"schedule": {
"hourly": {
"minute": [ 0, 5 ]
}
}
},
"input": {
"simple": {
"payload": {
"send": "yes"
}
}
},
"condition": {
"always": {}
}
}
resp = client.perform_request(
"PUT",
"/_watcher/settings",
headers={"Content-Type": "application/json"},
body={
"index.auto_expand_replicas": "0-4"
},
)
print(resp)
response = client.watcher.update_settings(
body: {
'index.auto_expand_replicas' => '0-4'
}
)
puts response
const response = await client.transport.request({
method: "PUT",
path: "/_watcher/settings",
body: {
"index.auto_expand_replicas": "0-4",
},
});
console.log(response);
PUT /_watcher/settings
{
"index.auto_expand_replicas": "0-4"
}
The configurable settings can be retrieved using the Get Watcher index settings API.