|
| 1 | +This guide explains how to define alert conditions in OpenObserve using logical operators and grouping rules. |
| 2 | + |
| 3 | +## Define Alert Conditions |
| 4 | +While creating an alert, you can define multiple conditions to determine when the alert should be triggered. Use logical operators such as AND and OR to combine conditions. These operators allow you to create structured, rule-based logic to control alert evaluation. |
| 5 | + |
| 6 | +**To define multiple conditions:** |
| 7 | + |
| 8 | +1. In the **Add Alert** view, navigate to the **Conditions** section. |
| 9 | +2. Select an operator between AND or OR at the top level. This operator will be applied across all items added at the same level. |
| 10 | +3. Define an individual condition using a column, an operator, and a value. |
| 11 | +4. Select **+ Condition** to add more conditions at the same level. |
| 12 | +5. Select **+ Condition Group** to add a grouped block of conditions. A group has its own operator, independent from the parent group or other groups at the same level. |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | +## Example |
| 17 | +The configuration shown in the image includes the following conditions: |
| 18 | + |
| 19 | +1. The top-level logical operator is `OR`. |
| 20 | +2. There are three items at the top level: |
| 21 | + |
| 22 | +- A condition: `k8s_namespace_name` equals `dev3` |
| 23 | +- A condition group with the `AND` operator: |
| 24 | + |
| 25 | + - `k8s_cluster` equals `common-dev` |
| 26 | + - `k8s_deployment_name` equals `ingress-nginx-controller` |
| 27 | + |
| 28 | +- Another condition group with the `AND` operator: |
| 29 | + |
| 30 | + - `k8s_pod_name` equals `dev3-openobserve-ingester` |
| 31 | + - `k8s_deployment_name` equals `dev3-openobserve-router` |
| 32 | + |
| 33 | +## How it works |
| 34 | +The alert is triggered if any one of these items is true: |
| 35 | + |
| 36 | +- `k8s_namespace_name` is `dev3`. |
| 37 | +- Both `k8s_cluster` is `common-dev` and `k8s_deployment_name` is `ingress-nginx-controller`. |
| 38 | +- Both `k8s_pod_name` is `dev3-openobserve-ingester` and `k8s_deployment_name` is `dev3-openobserve-router`. |
| 39 | + |
| 40 | +Because the top-level operator is `OR`, only one item must be true for the alert to trigger. |
0 commit comments