Re: [prometheus-users] PromQL Regex and the left bracket [ character

2021-04-22 Thread Patrick Mackey
Yes, that works. Thanks, Matthias!

On Thursday, 22 April 2021 at 08:13:25 UTC matt...@prometheus.io wrote:

> Try using [[] (match any of the following characters: [): 
> https://play.golang.org/p/ynvSW3lIHDY
>
> /MR
>
> On Thu, Apr 22, 2021 at 3:02 AM Patrick Mackey <
> patrick...@deniedaccess.org> wrote:
>
>> Hi, all.
>>
>> I'm trying to match the left bracket character '[' with a regex and seem 
>> to be hitting some issues. I've tried with the octal sequence \133 and the 
>> hex sequence \x5B but both return either false positive matches or the 
>> following error:
>>
>> Error executing query: invalid parameter "query": 1:19: parse error: 
>> error parsing regexp: missing closing ]: `[.*)$`
>>
>> I'm running 2.26.0 from Docker. 
>>
>> My query is variations of:
>> ifOperStatus{ifAlias=~"\133.*"}
>>
>> Matching the right bracket ']' with \135 and \x5D works fine.
>>
>> Any ideas?
>>
>> -- 
>> 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 prometheus-use...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/prometheus-users/083e9924-483c-4506-aba6-f35be725798an%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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 prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/031a8c61-b00f-4e82-9081-d36cac545b46n%40googlegroups.com.


Re: [prometheus-users] PromQL Regex and the left bracket [ character

2021-04-22 Thread Matthias Rampke
Try using [[] (match any of the following characters: [):
https://play.golang.org/p/ynvSW3lIHDY

/MR

On Thu, Apr 22, 2021 at 3:02 AM Patrick Mackey <
patrick.mac...@deniedaccess.org> wrote:

> Hi, all.
>
> I'm trying to match the left bracket character '[' with a regex and seem
> to be hitting some issues. I've tried with the octal sequence \133 and the
> hex sequence \x5B but both return either false positive matches or the
> following error:
>
> Error executing query: invalid parameter "query": 1:19: parse error: error
> parsing regexp: missing closing ]: `[.*)$`
>
> I'm running 2.26.0 from Docker.
>
> My query is variations of:
> ifOperStatus{ifAlias=~"\133.*"}
>
> Matching the right bracket ']' with \135 and \x5D works fine.
>
> Any ideas?
>
> --
> 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 prometheus-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-users/083e9924-483c-4506-aba6-f35be725798an%40googlegroups.com
> 
> .
>

-- 
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 prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/CAMV%3D_ganJQjaJjP%3DHUOLFC7j3PoCFXaVoi_rBwVOM6v8q1ZWdw%40mail.gmail.com.