Adding more than one regexp in blackbox.yml

60 views
Skip to first unread message

sanhita...@gmail.com

unread,
Apr 18, 2018, 1:02:10 PM4/18/18
to Prometheus Users
is it possible i can add two regex for checking is the page is up?? I have given the blackbox.yml file that i use below
. When i give 2 regex, it says the yml file cannot be executed(Error: msg="Error loading config" err="Error parsing config file: yaml: line 7: did not find expected '-' indicator"   )

modules:
  http_2xx:
    prober: http
    http:
      fail_if_matches_regexp:
        - "NO"
      fail_if_not_matches_regexp:
        - "YES", "GOOD"


Brian Brazil

unread,
Apr 18, 2018, 1:10:25 PM4/18/18
to sanhita...@gmail.com, Prometheus Users
The syntax for a YAML list would be :
      - YES
      - GOOD

Brian
 


--
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+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/320a618d-c31b-431d-bd11-8e9bd27a13da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

sanhita...@gmail.com

unread,
Apr 18, 2018, 1:20:22 PM4/18/18
to Prometheus Users
But this doesnt match the regex which leads to failure of all the services. Any other way of checking multiple regex in blackbox.yml??


On Wednesday, April 18, 2018 at 1:10:25 PM UTC-4, Brian Brazil wrote:
On 18 April 2018 at 18:02, <sanhita...@gmail.com> wrote:
is it possible i can add two regex for checking is the page is up?? I have given the blackbox.yml file that i use below
. When i give 2 regex, it says the yml file cannot be executed(Error: msg="Error loading config" err="Error parsing config file: yaml: line 7: did not find expected '-' indicator"   )

modules:
  http_2xx:
    prober: http
    http:
      fail_if_matches_regexp:
        - "NO"
      fail_if_not_matches_regexp:


 
        - "YES", "GOOD"

The syntax for a YAML list would be :
      - YES
      - GOOD

Brian
 

--
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 post to this group, send email to promethe...@googlegroups.com.



--

Anton Huck

unread,
Apr 19, 2018, 2:10:05 AM4/19/18
to Prometheus Users
have you tried following:

fail_if_not_matches_regexp:
- "(YES|GOOD)"

sanhita...@gmail.com

unread,
Apr 19, 2018, 8:42:32 AM4/19/18
to Prometheus Users
This works! Thank you!
Reply all
Reply to author
Forward
0 new messages