Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
2.8.0
Describe the issue:
Hello, everyone. I’m having trouble understanding how ISM works. I have the following configuration with which there are misunderstandings. If I understand correctly, when Shrink occurs, a new index is created and the old one is deleted. Accordingly, subsequent policy actions will not be applied to the new index. That is, the Force merge and move to cold actions will not occur. Also, I don’t understand how to add aliases during Shrink as they were in the original index. And lastly, maybe you can share your ISM examples so that I can create my own based on them. Thank you very much.
Configuration:
{
"policy": {
"policy_id": "logs-mssql.service-prod",
"description": "Windows MS SQL error logs",
"last_updated_time": 1690445583171,
"schema_version": 18,
"error_notification": null,
"default_state": "hot",
"states": [
{
"name": "hot",
"actions": [
{
"retry": {
"count": 3,
"backoff": "exponential",
"delay": "1m"
},
"rollover": {
"min_size": "120gb",
"min_index_age": "30d"
}
}
],
"transitions": [
{
"state_name": "warm",
"conditions": {
"min_rollover_age": "1d"
}
}
]
},
{
"name": "warm",
"actions": [
{
"retry": {
"count": 3,
"backoff": "exponential",
"delay": "1m"
},
"allocation": {
"require": {
"temp": "warm"
},
"include": {},
"exclude": {},
"wait_for": false
}
},
{
"retry": {
"count": 3,
"backoff": "exponential",
"delay": "1m"
},
"shrink": {
"num_new_shards": 3,
"target_index_name_template": {
"source": "{{ctx.index}}_shrunken",
"lang": "mustache"
},
"force_unsafe": false
}
},
{
"retry": {
"count": 3,
"backoff": "exponential",
"delay": "1m"
},
"force_merge": {
"max_num_segments": 1
}
},
{
"retry": {
"count": 3,
"backoff": "exponential",
"delay": "1m"
},
"rollover": {
"min_index_age": "120d"
}
}
],
"transitions": [
{
"state_name": "cold",
"conditions": {
"min_rollover_age": "1d"
}
}
]
},
{
"name": "cold",
"actions": [
{
"retry": {
"count": 3,
"backoff": "exponential",
"delay": "1m"
},
"allocation": {
"require": {
"temp": "cold"
},
"include": {},
"exclude": {},
"wait_for": false
}
}
],
"transitions": []
}
],
"ism_template": [
{
"index_patterns": [
"logs-mssql.service-prod"
],
"priority": 1,
"last_updated_time": 1687519653008
}
]
}
}
Relevant Logs or Screenshots: