You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/monitors/notify/variables.md
+11-3Lines changed: 11 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -141,8 +141,7 @@ Or use the `{{else}}` parameter in the first example:
141
141
@slack-example
142
142
{{/is_match}}
143
143
```
144
-
145
-
**Note**: To check if a `<TAG_VARIABLE>` is **NOT** empty, use an empty string for the `<COMPARISON_STRING>`.
144
+
**Note**: To check if a `<TAG_VARIABLE>` does not exist or if it's empty, use `is_exact_match`. See `is_exact_match` tab for more details.
146
145
147
146
{{% /tab %}}
148
147
{{% tab "is_exact_match" %}}
@@ -189,6 +188,14 @@ To notify your dev team if the value that breached the threshold of your monitor
189
188
{{/is_exact_match}}
190
189
```
191
190
191
+
The `is_exact_match` conditional variable also supports an empty string for the `<COMPARISON_STRING>` to check if the attribute or tag is empty or does not exist.
192
+
```text
193
+
{{#is_exact_match "host.datacenter" ""}}
194
+
This displays if the attribute or tag does not exist or if it's empty
195
+
{{/is_match}}
196
+
```
197
+
198
+
192
199
{{% /tab %}}
193
200
{{% tab "is_renotify" %}}
194
201
@@ -551,8 +558,9 @@ When building dynamic handles with attributes that might not always be present,
551
558
To avoid missed notifications when using dynamic handles with these variables, make sure to add a fallback handle:
552
559
553
560
```text
554
-
{{#is_match "kube_namespace.owner" ""}}
561
+
{{#is_exact_match "kube_namespace.owner" ""}}
555
562
@slack-example
563
+
// This will notify @slack-example if the kube_namespace.owner variable is empty or does not exist.
0 commit comments