Monitoring your websites and web applications for uptime and performance can be tough, because there are times when a page only loads partially, but you might not realize it. That is, unless you initiate a content match rule.

What is a Content Match?

A content match is a way of confirming that a page is up or down by matching a piece of loaded content to a reference point configured within your monitor settings.

  • If a monitor checking the page spots the content, no error is reported.
  • If a monitor checking the page cannot spot the content, an error is reported.

What types of content matching are possible?

Regular content match

Note: Works for HTTP / Webservices / RBC / FPC

A content match can be set up using regular expressions. A regular expression (regex or regexp for short) is a special text string for describing a search pattern.

  • Checking for just a single word: welcome
  • Regex for multiple words/phrases (must be in this particular order): product.*order (i.e. product AND order must appear)
  • Invert the entire clause by starting with exclamation mark, to test if the word is not present:
    !error (i.e. the word error must not appear)
    !error|sorry (i.e. NOT (error OR sorry))

Advanced content match

Note: Works for HTTP / Webservices

Advanced content match values are stored as JSON data.

[
{
"Pattern": "PhraseA",
"IsPositive": true
},
{
"Pattern": "PhraseB",
"IsPositive": false
}
]

Checking dates:

[
{
"Pattern": "some content before the timestamp value (?<hour>\\d\\d):(?<minute>\\d\\d)",
"IsPositive": true,
"DateTime": {
"OffsetUTC": 60,
"MaxDifference": 5
}
}
]

For datetime checking, there should be named groups in the regex, indicated by ?<year>, ?<month>, ?<day>, ?<hour>, ?<minute>, ?<second>.

Any of these values that can be extracted from the content, will be merged with the current server time, and then evaluated in terms of UTC.

OffsetUTC is the number of minutes that should be subtracted in order to compare it to server time in UTC.

Example: if the webpage contains a timestamp in UTC+1, the offset should be 60. If the webpage contains a timestamp in EST (UTC-5), the offset should be -300.

MaxDifference is the maximum difference in minutes that is allowed. This means that an error will occur if this maximum is exceeded. Example: if it’s now 10:06, and the content contains 10:00, an error will occur if MaxDifference is 5 or less.

Where to configure a content match

  1. Log into your Uptrends account.

  2. Go to the Monitor page, located under the Monitor dropdown menu.

  3. Select the service monitor you’d like to add a content match to.

  4. Navigate to the Alert Conditions tab.

  5. Add your content match information in the text entry box marked Page content match.

  6. Click the green Save button.