synthetic-monitoring-agent icon indicating copy to clipboard operation
synthetic-monitoring-agent copied to clipboard

Request to add a string matching functionality to the HTTP check

Open ChielWdvb opened this issue 2 years ago • 2 comments

Request to add a string matching functionality to the HTTP check: when the page is loaded with a 200 response, the page is checked for the presence of a given string. If the string is found the check is completed succesfully. The reason for this request is that when our application is functionally down, the domain will still be available and serve up a 200 OK response while showing a fallback error page instead of the correct page. The string matching functionality would allow us to verify that the correct page is shown. Various other synthetic monitoring applications offer this functionality and I to believe it to be fairly standard for this type of application.

ChielWdvb avatar Aug 14 '23 06:08 ChielWdvb

That exists under the Validation section of the check config. Regex Validation.

"Check fails if response body matches", use regex pattern match, then select Invert match to make it Successful if the pattern is found.

MaxDiOrio avatar Sep 11 '23 15:09 MaxDiOrio

Hi, thank you for your reply. I was given the same tip on the Grafana community site, but i've been unable to get it to work as expected. Do you have an example of a correct & working regex that checks for the presence of the string "Login" on a page?

ChielWdvb avatar Sep 12 '23 11:09 ChielWdvb