String matching for synthetic monitoring

Hello,
our organisation is looking onto replacing our current synthetic monitoring solution with the synthetic monitoring Grafana Cloud offers.
I’ve set up a free account to try some things and one of the first issues i’m running into is that a http check doesn’t have the option to check a page for the presence of a string. Am I overlooking something or is this simply not currently an option?
If it is currently not an option, is there any way to submit a feature request to have this added?
The reason i’m asking for this functionality 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.
I believe this to be fairly standard functionality in Synthetic Monitoring applications, and I was surprised to see it was missing in Grafana Synthetic monitoring…

You can do this under validation → select Regex Validation → Check fails if response body matches, then put your regex in.

Hi Jacob, thank you for your answer.
While the regex validation option appears to do something in the right direction of what i’m looking for, i’m not getting the result I need.
For example when I enter Login as the regex string, which is a string I expect to find if the correct page is loaded, the checks will fail if the string is found, where I would want the check to succeed if the string is found and fail otherwise.
I’m currently testing how the “Invert match” option works for this.

.+(?:Login).+

Use that above regex, and use the Invert Match. This will mean that the check will fail if login is not found. Make sure to also select the body to search and not the headers.

1 Like

Hi again Jacob,
I tried your suggestion and it initially appeared to work as I had hoped. However on closer inspection it seems I can enter any string in the regex and the check will pass regardless, even with a string of which i’m very sure that it can’t be found on the page.
I’m trying some other regex variations but with no succes so far.