How Does Content Match Work?

Note: Content Match is a Paid Feature and as such requires any account above free

stringmatch

The Content match feature will match any given string on the entire request body. The request body includes everything from the <html> to the </html>.This means you can match any element such as items within meta tags or alt tags of images. Content match is case sensitive so you will be required to put the string excactly how it shows on your pages HTML. Whitespace and line breaks will be searched for; so if your html has a line break your string match will be required to have a line break also.

You can pick either to alert if the string is not found or is found. You might want to pick alert if the string is not found if you expect a certain peice of text to be on the site when it’s running normally (such as your companys name).

You can also match multiple strings, each string you want to match should be separated by a comma, and all strings must be present to give a successful result.

On the flip side you may want to alert if a string is found for cases such as a PHP error or a HTML comment you’ve embedded in your page to say if you have a DB issue.

If you are looking to ensure your page is running as expected then try to pick a string to match as close to the bottom of the page as possible. This will ensure that the entire page contents has rendered (rather than being stopped by a parsing error for example). You could even use </html>!

Here are some ideas of how to use content match

  • Create a small script that echos a warning if your servers load is high
  • Connect to the DB and if connection fails echo out a simple string
  • Ensure your page is how you expect and contains all strings, great way to alert on defacing.

Please ensure you following the rules below:

  • Try to find plain text sections to match. Do not match UTF-8 Characters such as trademark symbols or ampersands unless you are using HTML entities.
  • Line breaks and spaces are included in the matching; if you have a line break you will need to also include this in string match
  • The match is taken from the HTML source, any post JS changes will be ignored.

Related Articles