Check for request response body match #157
-
Currently, we can only check for an exact body to consider a fail. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
So, you're saying, like we can use sites:
- name: Custom down
url: https://example.com
__dangerous__body_down: "File not found" We can do sites:
- name: Custom down
url: https://example.com
__dangerous__body_down_if_text_missing: "Everything looks good" In the above example, if the body doesn't include the text "Everything looks good", we'll mark the site as down. Is this right? Happy to add this feature. |
Beta Was this translation helpful? Give feedback.
-
Yes, this is exactly what I had in mind ^^ |
Beta Was this translation helpful? Give feedback.
-
Done, this has been added in @upptime/[email protected]: sites:
- name: Custom down
url: https://example.com
__dangerous__body_down_if_text_missing: "Everything looks good"
__dangerous__body_degraded_if_text_missing: "Everything is fast" |
Beta Was this translation helpful? Give feedback.
-
I think it is a bit sad to only be able to match against one "word". Would it be possible to match against a regex or perhaps easier doable in yaml: a list of elements? |
Beta Was this translation helpful? Give feedback.
Done, this has been added in @upptime/[email protected]: