On Sat, 23 May 2020 at 13:25, Stevo Slavić <[email protected]> wrote:

> Hello Prometheus users,
>
> Does label_replace regex support negative lookahead?
>

Prometheus uses Go's regexes which are RE2, and thus don't support negative
lookahead. You can usually workaround by using negative regex matchers.

Brian


>
> I tried using as last parameter "^((?!foo).)*$" but get the error:
>
> Error executing query: invalid regular expression in label_replace():
> ^((?!foo).)*$
>
> Same for "^(?!foo).*$"
>
> Kind regards,
> Stevo Slavic.
>
> --
> 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/5fb51c41-4ef6-47a0-b9a2-9b2da01bdd26%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-users/5fb51c41-4ef6-47a0-b9a2-9b2da01bdd26%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Brian Brazil
www.robustperception.io

-- 
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/CAHJKeLrrCd32ab67ci30O96vHkVv6dbaqPoB5kLjOFs-BmywfQ%40mail.gmail.com.

Reply via email to