On this page
相关性 object
以下 objects 与 correlation API 直接相关。
关联
correlation 对象具有以下属性。
| Property | Type | Description |
|---|---|---|
| correlationid | ID | correlation 的 ID。 属性行为: - 只读 - 在更新操作中为 必需 |
| name | string | correlation 的名称。 属性行为: - 在创建操作中为 必需 |
| description | string | correlation 的描述。 |
| status | integer | correlation 是启用还是禁用。 可能的值: 0 - (默认) 启用; 1 - 禁用。 |
关联操作
关联操作对象定义了在执行关联时将执行的操作。它具有以下属性。
关联过滤器
关联过滤器对象定义了一组必须满足的条件,以执行已配置的关联操作。 它具有以下属性。
| Property | Type | Description |
|---|---|---|
| conditions | array | 用于筛选结果的过滤条件集合。这些条件将按照它们在公式中的排列顺序进行排序。 Property behavior: - required |
| evaltype | integer | 过滤条件的求值方法。 Possible values: 0 - And/Or; 1 - And; 2 - Or; 3 - Custom expression. Property behavior: - required |
| eval_formula | string | 用于计算过滤条件的生成表达式。该表达式包含引用特定过滤条件的 ID,这些 ID 通过其 formulaid 标识。对于使用自定义表达式的过滤器,eval_formula 的值等于 formula 的值。Property behavior: - read-only |
| formula | string | 用户定义的表达式,用于计算使用自定义表达式的过滤器条件。该表达式必须包含引用特定过滤条件的 ID,这些 ID 通过其 formulaid 标识。表达式中使用的 ID 必须与过滤条件中定义的 ID 完全一致:不能有任何条件未使用或被省略。Property behavior: - required if evaltype is set to "custom expression" |
关联过滤条件
关联过滤条件对象定义了一个特定条件,在执行关联操作之前必须对其进行检查。
| Property | Type | Description |
|---|---|---|
| type | integer | 条件类型。 可能的值: 0 - 旧事件标签; 1 - 新事件标签; 2 - 新事件主机组; 3 - 事件标签对; 4 - 旧事件标签值; 5 - 新事件标签值。 Property behavior: - required |
| tag | string | 事件标签(旧或新)。 Property behavior: - 如果 type 设置为 "old event tag"、"new event tag"、"old event tag value" 或 "new event tag value",则为 required |
| groupid | ID | 主机组的 ID。 Property behavior: - 如果 type 设置为 "new event host group",则为 required |
| oldtag | string | 旧事件标签。 Property behavior: - 如果 type 设置为 "event tag pair",则为 required |
| newtag | string | 旧事件标签。 Property behavior: - 如果 type 设置为 "event tag pair",则为 required |
| value | string | 事件标签(旧或新)值。 Property behavior: - 如果 type 设置为 "old event tag value" 或 "new event tag value",则为 required |
| formulaid | string | 用于在自定义表达式中引用该条件的任意唯一 ID。只能包含大写字母。修改过滤条件时必须由用户定义,但在之后再次请求时会重新生成。 |
| operator | integer | 条件运算符。 Property behavior: - 如果 type 设置为 "new event host group"、"old event tag value" 或 "new event tag value",则为 required |
要更好地理解如何将过滤器与各种 类型的表达式一起使用,请参见 correlation.get 和 correlation.create 方法 页面中的示例。
以下运算符和值适用于每种条件 类型。
| Condition | Condition name | Supported operators | Expected value |
|---|---|---|---|
| 2 | 主机组 | =, <> | 主机组 ID。 |
| 4 | 旧事件标签值 | =, <>, like, not like | string |
| 5 | 新事件标签值 | =, <>, like, not like | string |