我正在尝试在 AWS elasticsearch 中执行此操作,从而为模式application-logs-*
创建一个模板,然后我想为与该表达式匹配的所有索引应用索引策略log-rotation-policy
。我已经成功创建了我的策略,但是当我尝试创建这样的模板时:
PUT _template/application-logs
{
"index_patterns" : [
"application-logs-*"
],
"settings" : {
"index.lifecycle.name": "log-rotation-policy",
}
}
我收到一个错误:
"type": "illegal_argument_exception",
"reason": "unknown setting [index.policy_id] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"
AWS 文档非常模糊,
好的,对不起,我想无论如何我都会发布这个答案,因为在我写这篇文章时我发现了问题所在,正确的键 o 使用是:opendistro.index_state_management.policy_id
所以它应该是:
PUT _template/application-logs
{
"index_patterns" : [
"application-logs-*"
],
"settings" : {
"opendistro.index_state_management.policy_id": "log-rotation-policy",
}
}
我在这里找到了答案。