ElastAlert - 在 config.yaml 中覆盖 run_every

ElastAlert - override run_every in config.yaml

是否可以覆盖 config.yaml 中的 run_every 属性?

基本上我有一个 config.yaml,其中包含以下行:

run_every:
    seconds: 30

现在我有五个使用此 config.yaml 的规则。所以他们都每 30 秒 运行ning 一次。在第五条规则上,我想每 60 秒 运行,但是如果我将以下行放在 fifth-rule.yaml:

run_every:
    seconds: 60

它仍然每 30 秒 运行s。有什么想法吗?

在每个规则中,您可以通过 "import" 命令共享设置文件。 "If specified includes all the settings from this yaml file. This allows common config options to be shared. Note that imported files that aren’t complete rules should not have a .yml or .yaml suffix so that ElastAlert doesn’t treat them as rules."

我通过为需要 60 秒的规则创建不同的 config.yaml 并通过配置选项将其提供给 elastalert.py.

解决了类似的问题

默认情况下 elastalert.py 使用 config.yaml 这可以用 --config 选项覆盖,如下所示:

python elastalert/elastalert.py --config configoverride.yaml