33 lines
800 B
Plaintext

//PUT _ilm/policy/logstash_1m_candle_policy
{
"policy": {
"phases": {
"hot": {
"actions": {
"rollover": {
"max_size": "10GB",
"max_age": "30d" // 7 天滚动,频繁数据快速积累
},
"allocate": { "_tier_preference": "data_hot" }
}
},
"warm": {
"min_age": "100d", // 30 天进入 warm
"actions": {
"allocate": { "_tier_preference": "data_warm" }
}
},
"cold": {
"min_age": "300d", // 90 天进入 cold
"actions": {
"allocate": { "_tier_preference": "data_cold" },
"shrink": { "number_of_shards": 1 }
}
},
"delete": {
"min_age": "1000d" // 1 年后删除
}
}
}
}