On Monday, 26 October 2020 19:42:56 UTC, Brian Gottfried wrote:
>
> Hello! I'm looking to forward specific alerts via the Webhook config and 
> can't find the best way to specify the specific alerts I want to match. For 
> the moment, the # of alerts is small enough that I can specify a route for 
> each alert individually
> e.g.
> routes:
>   - receiver: 'dest'
>     match:
>       alertname: A
>   - receiver: 'dest'
>     match:
>       alertname: B
> ...
>
> But I'm assuming there's a better way to do so? Can you add multiple 
> alerts in the alertname field, separated by commas or some other divider? I 
> think I saw a "match_re" field that would let you do it via regex?
>

Yes.

    match:
      alertname: A
      severity: critical

will mean that *both* those labels must have the values given..

    match_re:
      alertname: 'A|B'
      severity: 'critical|warning'

will match alertname "A" or "B", *and* at the same time must have severity 
"critical" or "warning". And

    match_re:
      alertname: 'A|B'
    match:
      severity: critical

will match alerts where the alertname is "A" or "B", and the severity is 
"critical".

 

> And more generally, is there something in the Alertmanager configuration 
> documentation 
> <https://www.prometheus.io/docs/alerting/latest/configuration/>that 
> specifies these options that I missed?
>

The bit which shows match and match_re is under "route":
https://prometheus.io/docs/alerting/latest/configuration/#route
 

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/f91b1351-7727-47d5-b06d-ad98b6878fabo%40googlegroups.com.

Reply via email to