加载中

日志动作

使用 logging 操作将文本记录到标准的 Elasticsearch 日志中。请参阅 日志操作属性 以了解支持的属性。

此操作主要用于开发和调试目的。

您可以在 actions 数组中配置日志操作。操作特定的属性使用 logging 关键字指定。

以下代码片段显示了一个简单的日志操作定义

"actions" : {
  "log" : {
    "transform" : { ... },
    "logging" : {
      "text" : "executed at {{ctx.execution_time}}"
    }
  }
}
		
  1. 该操作的 ID。
  2. 在执行 logging 操作之前转换有效负载的可选 transform
  3. 要记录的文本。
名称 必填 默认值 描述
text - 应该记录的文本。可以是静态文本,也可以包含 Mustache 模板
类别 xpack.watcher.actions.logging 记录文本所属的类别。
level info 日志级别。有效值为:errorwarninfodebugtrace
© . 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.