3

In the docs, it says that we can add a set of match clauses under match:. It says literally:

A set of equality matchers an alert has to fulfill to match the node.

match:
[ <labelname>: <labelvalue>, ... ]

But it doesn't tell us how to actually provide there multiple matchers. Neither does it tell us if these matchers and ANDed or ORd.

So my two questions are:

  1. How does one properly provide multiple match clauses for a receiver?
  2. Will these match clauses be ANDed or ORd?
Sahand
  • 7,980
  • 23
  • 69
  • 137

2 Answers2

2
  1. How does one properly provide multiple match clauses for a receiver?

I would expect following to work:

match:
  label1: value1
  lavel2: value2
  1. Will these match clauses be ANDed or ORd?

All clauses have to match, i.e. the clauses are ANDed.

slauth
  • 2,667
  • 1
  • 10
  • 18
1

Just confirming that you can add multiple match clauses, which are ANDed. Means all clauses have to match.

Like for example:

routes:
    - matchers:
        - name: severity
          value: warning
        - name: foo
          value: bar
      receiver: slack
      repeatInterval: 24h
    - matchers:
        - name: severity
          value: warning
      receiver: msteams
      repeatInterval: 24h

In the example above, both clauses watch on the same severity but the alert message will only be send to the slack receiver, when also the label foo=bar matches. Otherwise the alert will only be send to the msteams receiver.

Per Lundberg
  • 3,837
  • 1
  • 36
  • 46
robenn11
  • 21
  • 5