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: 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 1. Create a policy with an `ism_template` field:
PUT _opensearch/_ism/policies/rollover_policy
{ ```json
PUT _opensearch/_ism/policies/rollover_policy
{
"policy": { "policy": {
"description": "Example rollover policy.", "description": "Example rollover policy.",
"default_state": "rollover", "default_state": "rollover",
@ -549,44 +551,44 @@ PUT _opensearch/_ism/policies/rollover_policy
"priority": 100 "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 ```json
PUT _template/ism_rollover PUT _index_template/ism_rollover
{ {
"index_patterns": ["log*"], "index_patterns": ["log*"],
"settings": { "settings": {
"opensearch.index_state_management.rollover_alias": "log" "opensearch.index_state_management.rollover_alias": "log"
} }
} }
``` ```
1. Create an index with the `log` alias: 3. Create an index with the `log` alias:
```json ```json
PUT log-000001 PUT log-000001
{ {
"aliases": { "aliases": {
"log": { "log": {
"is_write_index": true "is_write_index": true
} }
} }
} }
``` ```
1. Index a document to trigger the rollover condition: 4. Index a document to trigger the rollover condition:
```json ```json
POST log/_doc POST log/_doc
{ {
"message": "dummy" "message": "dummy"
} }
``` ```
## Example policy ## Example policy