In the version you are using it's called "fail_if_matches_regexp" and "fail_if_not_matches_regexp".
Marcelo On Thu, Apr 1, 2021 at 10:29 AM Michał Siwik <[email protected]> wrote: > Marcelo, > > In second example when I copy config from blackbox-exporter repo > cat blackbox2.yml > > modules: > http_2xx_example: > prober: http > timeout: 5s > http: > valid_http_versions: ["HTTP/1.1", "HTTP/2.0"] > valid_status_codes: [] # Defaults to 2xx > method: GET > headers: > Host: vhost.example.com > Accept-Language: en-US > Origin: example.com > no_follow_redirects: false > fail_if_ssl: false > fail_if_not_ssl: false > fail_if_body_matches_regexp: <- this is line 16 > - "Could not connect to database" > fail_if_body_not_matches_regexp: > - "Download the latest version here" > > prometheus-blackbox-exporter --config.file blackbox2.yml --config.check > level=info ts=2021-04-01T06:38:02.91294192Z caller=main.go:215 > msg="Starting blackbox_exporter" version="(version=0.13.0+ds, > branch=debian/sid, revision=0.13.0+ds-2+b11)" > level=error ts=2021-04-01T06:38:02.913576183Z caller=main.go:219 > msg="Error loading config" err="Error parsing config file: yaml: unmarshal > errors:\n line 16: field fail_if_body_matches_regexp not found in type > config.plain\n line 18: field fail_if_body_not_matches_regexp not found in > type config.plain" > > czwartek, 1 kwietnia 2021 o 15:50:06 UTC+2 Marcelo Magallón napisał(a): > >> I apologize for using YAML, whitespace-sensitve-anythings should have >> never been put into use... >> >> The problem is that here: >> >> On Thu, Apr 1, 2021 at 12:41 AM Michał Siwik <[email protected]> wrote: >> >> http_get_api_zkat: >>> prober: http >>> timeout: 5s >>> http: >>> method: GET >>> headers: >>> Content-Type: "application/json" >>> fail_if_body_not_matches_regexp: >>> - "^{heheszki}$" >>> >> >> fail_if_body_not_matches_regexp is indented at the same level as >> Content-Type before it. If you align it under "headers" it works. >> >> Marcelo >> > -- > 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/57f9125a-35b4-4d32-9545-51cdab1c9dffn%40googlegroups.com > <https://groups.google.com/d/msgid/prometheus-users/57f9125a-35b4-4d32-9545-51cdab1c9dffn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Marcelo Magallón -- 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/CABiJYgYFnT4scN27Xyr4qaFQB3H2soMWww90sq2BVMndNA%3DoCQ%40mail.gmail.com.

