Skip to content

关于本页

本页介绍更夫所基于的开源内核 Keep 的通用能力。更夫在其上提供国内化增强:钉钉/企业微信/飞书通知、国产大模型接入、LDAP 认证与值班管理。部署与上手请看快速上手。

创建提取规则。

用法 ​

Usage: keep extraction create [OPTIONS]

选项 ​

  • name

    • 类型:STRING
    • 默认值:``
    • 用法:--name <extraction-name>

    提取的名称。

  • description

    • 类型:STRING
    • 默认值:``
    • 用法:--description <extraction-description>

    提取的描述。

  • priority

    • 类型:INTEGER RANGE
    • 默认值:0
    • 用法:--priority <priority>

    提取的优先级,优先级越高表示此规则将首先执行。 0<=x<=100。

  • pre

    • 类型:BOOL
    • 默认值:false
    • 用法:--pre <pre>

    此规则应在告警标准化之前还是之后应用

  • attribute

    • 类型:STRING
    • 默认值:``
    • 用法:--attribute <extraction-attribute>

    要提取的事件属性名称。

  • regex

    • 类型:STRING
    • 默认值:``
    • 用法:--attribute <regex-regex>

    用于提取的正则规则。正则格式应为 Python 正则模式,用于分组匹配。

  • condition

    • 类型:STRING
    • 默认值:``
    • 用法:--condition <condition-attribute>

    基于 CEL 的条件。

  • help:

    • 类型:BOOL
    • 默认值:false
    • 用法:--help

    显示此消息并退出。

CLI 帮助 ​

Usage: cli.py extraction create [OPTIONS]

  Create a extraction rule.

Options:
  -n, --name TEXT               The name of the extraction.  [required]
  -d, --description TEXT        The description of the extraction.
  -p, --priority INTEGER RANGE  The priority of the extraction, higher
                                priority means this rule will execute first.
                                [0<=x<=100]
  --pre BOOLEAN                 Whether this rule should be applied before or
                                after the alert is standardized.
  -a, --attribute TEXT          Event attribute name to extract from.
                                [required]
  -r, --regex TEXT              The regex rule to extract by. Regex format
                                should be like python regex pattern for group
                                matching.  [required]
  -c, --condition TEXT          CEL based condition.  [required]
  --help                        Show this message and exit.

基于 MIT 协议开源的 Keep · 由更夫社区维护