mirror of
https://github.com/prometheus/alertmanager
synced 2025-01-12 09:10:13 +00:00
fixup examples
Signed-off-by: aSquare14 <atibhi.a@gmail.com>
This commit is contained in:
parent
b103eff7d5
commit
fc42013dad
@ -603,19 +603,19 @@ Here are some examples of valid string matchers :
|
|||||||
2. Similar to example 1, shown below are two equality matchers combined in a short form YAML list.
|
2. Similar to example 1, shown below are two equality matchers combined in a short form YAML list.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
matchers: [ "foo = bar", "dings != bums" ]
|
matchers: [ foo = bar, dings != bums ]
|
||||||
```
|
```
|
||||||
|
|
||||||
As shown below, in the short-form, it's generally better to quote the list elements to avoid problems with special characters like commas:
|
As shown below, in the short-form, it's generally better to quote the list elements to avoid problems with special characters like commas:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
matchers: [ '{foo="bar",dings!="bums"}' ]
|
matchers: [ "foo = bar,baz", "dings != bums" ]
|
||||||
```
|
```
|
||||||
|
|
||||||
3. You can also put both matchers into one PromQL-like string. Single quotes for the whole string work best here.
|
3. You can also put both matchers into one PromQL-like string. Single quotes for the whole string work best here.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
matchers: ['{env=~"produ.*"}', '{baz!~".*quux"}']
|
matchers: [ '{foo="bar",dings!="bums"}' ]
|
||||||
```
|
```
|
||||||
|
|
||||||
4. To avoid any confusion about YAML string quoting and escaping, you can use YAML block quoting and then only worry about the OpenMetrics escaping inside the block. A complex example with a regular expression and different quotes inside the label value is shown below:
|
4. To avoid any confusion about YAML string quoting and escaping, you can use YAML block quoting and then only worry about the OpenMetrics escaping inside the block. A complex example with a regular expression and different quotes inside the label value is shown below:
|
||||||
|
Loading…
Reference in New Issue
Block a user