Regexp match in template

19 views
Skip to first unread message

fiala...@gmail.com

unread,
Jun 28, 2024, 5:49:00 AM (9 days ago) Jun 28
to Prometheus Users
Hi,

is it possible to make a regexp match in annotation?

I need to check, if label contains specific string.

function "regexMatch" not definedThank you.

Brian Candler

unread,
Jun 28, 2024, 9:59:48 AM (9 days ago) Jun 28
to Prometheus Users
See the template functions listed here:

There is one called "match" which matches regular expressions. (Note that there is not one called "regexMatch")

You should also be able to use the go template global functions:
If this is for alerts, it might be simpler to use routing rules, with two different alert receivers.
Reply all
Reply to author
Forward
0 new messages