8000 Update is_match behaviour with empty string by SimoneT-DD · Pull Request #29309 · DataDog/documentation · GitHub
[go: up one dir, main page]

Skip to content

Update is_match behaviour with empty string #29309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 19, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions content/en/monitors/notify/variables.md
8000
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ Or use the `{{else}}` parameter in the first example:
@slack-example
{{/is_match}}
```

**Note**: To check if a `<TAG_VARIABLE>` is **NOT** empty, use an empty string for the `<COMPARISON_STRING>`.
**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.

{{% /tab %}}
{{% tab "is_exact_match" %}}
Expand Down Expand Up @@ -189,6 +188,14 @@ To notify your dev team if the value that breached the threshold of your monitor
{{/is_exact_match}}
```

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.
```text
{{#is_exact_match "host.datacenter" ""}}
This displays if the attribute or tag does not exist or if it's empty
{{/is_match}}
```


{{% /tab %}}
{{% tab "is_renotify" %}}

Expand Down Expand Up @@ -551,8 +558,9 @@ When building dynamic handles with attributes that might not always be present,
To avoid missed notifications when using dynamic handles with these variables, make sure to add a fallback handle:

```text
{{#is_match "kube_namespace.owner" ""}}
{{#is_exact_match "kube_namespace.owner" ""}}
@slack-example
// This will notify @slack-example if the kube_namespace.owner variable is empty or does not exist.
{{/is_match}}
```

Expand Down
Loading
0