加载中

warn_if_no_indices

注意

此设置仅由 alias 动作使用。

此设置必须是 TrueFalse

此设置的默认值为 False

action: alias
description: "Add/Remove selected indices to or from the specified alias"
options:
  name: alias_name
  warn_if_no_indices: False
add:
  filters:
  - filtertype: ...
remove:
  filters:
  - filtertype: ...
		

此设置指定在 add 或 remove 部分的过滤器导致索引列表为空的情况下,alias 动作是应该继续并发出警告,还是立即返回。

不当使用此设置可能会产生不理想的结果

理想使用案例: 例如,您希望将最近 7 天的时间序列索引添加到 lastweek 别名中,并从该别名中删除超过 7 天的索引。如果您还没有任何超过 7 天的索引,这将导致索引列表为空的情况,从而阻止整个 alias 动作成功完成。但是,如果 warn_if_no_indices 设置为 True,它将避免这种潜在结果。

潜在的不良结果: 一个 不利 的案例是,如果 warn_if_no_indices 设置为 True,且配置错误导致未找到索引,因此索引未从别名中解除关联。结果,一个原本应该只查询一周数据的别名现在引用了多周的数据。如果 warn_if_no_indices 设置为 False,这种情况本可以避免,因为空列表条件会导致错误。

© . This website operates independently and is not affiliated with or endorsed by Elasticsearch B.V. All brand names, logos, and trademarks are the property of their respective owners.