0

我想要一个手表,当给定查询的文档数在特定值范围之间时发出警报。我创建了一个简单的文件脚本 value_between.groovy 来测试它。该脚本包含以下内容:

return ctx.payload.hits.total > lower_limit && ctx.payload.hits.total < upper_limit

我的手表状况如下:

  "condition":
    {
      "script":
      {
        "file": "value_between",
        "params":
        {
          "lower_limit": 50,
          "upper_limit": 100
        }
      }
    }

每次此手表运行时,它都会失败,并显示以下日志消息。

[2016-10-12 13:22:27,285][ERROR][watcher.condition.script ] [elk-node] failed to execute [script] condition for [test-watch_174-2016-10-12T12:29:20.042Z]
ScriptException[failed to run file script [value_between] using lang [groovy]]; nested: MissingPropertyException[No such property: value for class: 5614867be4d02007620aca2099ecab8f6f899536];

非常感谢您的帮助!

4

0 回答 0