notifications: match-field 'exact'-mode can now match multiple values

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
This commit is contained in:
Lukas Wagner 2024-07-08 11:38:11 +02:00 committed by Thomas Lamprecht
parent 3b55c73fc2
commit 4931726c4e

View File

@ -233,11 +233,16 @@ configurable schedule.
Field Matching Rules
~~~~~~~~~~~~~~~~~~~~
Notifications have a selection of metadata fields that can be matched.
When using `exact` as a matching mode, a `,` can be used as a separator.
The matching rule then matches if the metadata field has *any* of the specified
values.
* `match-field exact:type=vzdump` Only match notifications about backups.
* `match-field exact:type=replication,fencing` Match `replication` and `fencing` notifications.
* `match-field regex:hostname=^.+\.example\.com$` Match the hostname of
the node.
If a matched metadata field does not exist, the notification will not be
matched.
For instance, a `match-field regex:hostname=.*` directive will only match
@ -279,18 +284,7 @@ matcher: backup-failures
comment Send notifications about backup failures to one group of admins
matcher: cluster-failures
match-field exact:type=replication
match-field exact:type=fencing
mode any
target cluster-admins
comment Send cluster-related notifications to other group of admins
----
The last matcher could also be rewritten using a field matcher with a regular
expression:
----
matcher: cluster-failures
match-field regex:type=^(replication|fencing)$
match-field exact:type=replication,fencing
target cluster-admins
comment Send cluster-related notifications to other group of admins
----