The Network Response Modifier allows you to set a series of monitoring and alerting rules based on specific content, domain name, and error type.

For example, if you want to monitor and record all errors detected, but you do not wish to trigger alert messages for certain content, you can use the network response modifier to create such a filter.

To add a new network filter, from the script context menu, select Network > Response Modifier, and select one from the available options. There are several types of network response modifiers:

  • OK
  • Error
  • Skip
  • Shadow
  • Clear

Details of the acceptable use of each response modifier can be found below.

NetworkResponseModifier.OK

NetworkResponseModifier.OK can be used to overwrite any error status with an OK value for the given variables but it will retain a shadow copy of the original error code that is ignored by notification rules and is not counted in response statistics.

The NetworkResponseModifier.OK accepts up to 3 variables:

  • URL string mask – the URL mask can be any string found in the URL utilizing * as a wildcard at the beginning or end of the string and ? as a single letter wildcard.
  • ErrorType – the error type is a drop-down field that contains all error types detectable by the script.
  • ErrorCode – the error code is a numeric value returned by the web server indicating the specific error.

The URL string mask is a required field, and the Error Type and Error Code are option values. The syntax used in the script is:

NetworkResponseModifier.OK(string mask, ErrorTypes ErrorType, int ErrorCode)

Example:

NetworkResponseModifier.OK(“www.example.com/mychart”)
NetworkResponseModifier.OK(“www.example.com/*”, errortypes.http, 404)

NetworkResponseModifier.Error

NetworkResponseModifier.Error will automatically generate the specified error which will be processed by alert notification rules and will be counted in the response statistics. It will also create a shadow copy of the original response which is not processed by notification rules or in-response statistics.

An example where a NetworkResponseModifier.Error might be useful if you wish to generate an error if the content from a specific URL is ever called from a webpage.

The NetworkResponseModifier.Error accepts 4 variables:

  • URL string Mask – the URL mask can be any string found in the URL utilizing * as a wildcard at the beginning or end of the string and ? as a single letter wildcard.
  • Error Description – a string that you can type in whatever description you want to be recorded in the error log.
  • Error Type – the error type is a drop-down field that contains all error types detectable by the script.
  • ErrorCode  – the error code is a numeric value returned by the web server indicating the specific error.

The URL string mask is a required field, the Error Description is a required field, Error Type and Error Code are option values. The syntax used in the script is:

NetworkResponseModifier.Error(string mask, string ErrorDescription, ErrorTypes ErrorType, int ErrorCode)

Example:

NetworkResponseModifier. Error (“www.example.com/*”,”page not found”, errortypes.http, 404)

NetworkResponseModifier.Skip

Will ignore previously defined Network Response Modifiers (related to the URL string mask entered) from this point in the script forward. Additional modifiers added after a skip will continue to act as normal.

The NetworkResponseModifier.Error accepts 1 variable:

  • URL string Mask – the URL mask can be any string found in the URL utilizing * as a wildcard at the beginning or end of the string and ? as a single letter wildcard.

The syntax used in the script is:

NetworkResponseModifier.Skip(URLString mask)

Example:

NetworkResponseModifier.Skip(“www.example.com/*”)

NetworkResponseModifier.Shadow

NetworkResponseModifier.Shadow will shadow responses that match the URL mask regardless of the value of the response. Shadowed responses will be ignored by notification rules and are not counted in response statistics.

The NetworkResponseModifier.Shadow accepts 1 variable:

  • URL string mask  – the URL mask can be any string found in the URL utilizing * as a wildcard at the beginning or end of the string and ? as a single letter wildcard.

The URL string mask is a required field. The syntax used in the script is:

NetworkResponseModifier.Shadow (string mask)

Example:

 NetworkResponseModifier.Shadow("www.example.com")

NetworkResponseModifier.Clear

Will clear the stack of all the Network Response Modifier rules.