Hi,
We have a monitor setup that alerts us if any ERROR keyword is shown in the API response data.
Content Checks -> Should not contain strings field: "error"
But this is triggering if there are such keywords containing the error part of it. Eg: 'terrorism'
We are getting the alert: The String "error" is present in the response.
Is there a way to fine-tune this?
thanks,
Krish
Hi Krishnarao,
We believe our regular expression checks from the "Content Checks" section suits well for your use case.
Please try the below pattern in the "Should match regular expression" field.
(?s)^((?!(\berror\b)).)*$
This regex pattern will look for the exact word "error" in the response. it'll not take error from terrorism (or) errorless (or) terror. So you'll get notified if it present.
We hope this meets your requirement and let us know if you have any further queries.
-Rajesh
Product Developer, Site24x7
Thanks for the detials Rajesh,
I can see that your method will works for the "Should contain strings", But my query is regarding the Field: Should not contain strings
regards,
Krish
Hi Krishnarao,
We don't have support for regex in the "Shoud not contains" field.
As a workaround, you could use the regex from my previous reply in the "Should match regular expression" field.
As we used Negative Lookahead "(?!)" in the regex pattern, it will fail if the word "error" is present.
So This will act as "Should not contain" and you'll get notified.
-Rajesh
Product Developer, Site24x7