Manually port policy changes

This commit is contained in:
aetter 2021-05-06 10:30:11 -07:00
parent 16fc67535c
commit 32165a4ccd
1 changed files with 58 additions and 56 deletions

View File

@ -523,11 +523,13 @@ You can use the same options for `ctx` variables as the [notification](#notifica
The following sample template policy is for a rollover use case:
1. Create a policy with an `ism_template` field.
The following sample template policy is for a rollover use case.
```json
PUT _opensearch/_ism/policies/rollover_policy
{
1. Create a policy with an `ism_template` field:
```json
PUT _opensearch/_ism/policies/rollover_policy
{
"policy": {
"description": "Example rollover policy.",
"default_state": "rollover",
@ -549,44 +551,44 @@ PUT _opensearch/_ism/policies/rollover_policy
"priority": 100
}
}
}
```
}
```
You need to specify the `index_patterns` field. If you don't specify a value for `priority`, it defaults to 0.
You need to specify the `index_patterns` field. If you don't specify a value for `priority`, it defaults to 0.
1. Set up a template with the `rollover_alias` as `log` :
2. Set up a template with the `rollover_alias` as `log` :
```json
PUT _template/ism_rollover
{
```json
PUT _index_template/ism_rollover
{
"index_patterns": ["log*"],
"settings": {
"opensearch.index_state_management.rollover_alias": "log"
}
}
```
}
```
1. Create an index with the `log` alias:
3. Create an index with the `log` alias:
```json
PUT log-000001
{
```json
PUT log-000001
{
"aliases": {
"log": {
"is_write_index": true
}
}
}
```
}
```
1. Index a document to trigger the rollover condition:
4. Index a document to trigger the rollover condition:
```json
POST log/_doc
{
```json
POST log/_doc
{
"message": "dummy"
}
```
}
```
## Example policy