Scope

The Scope is used for limiting the capture. For example, you may only be interested in requests from a specific hostname or files of specific type. The Scope will help you define that. The Scope Expression is matched against the URL of the request. Multiple scopes can be selected.

There are two methods to define a Scope: globs and regular expressions:

Globs

Globs are a popular a pattern matching feature. Here are a few examples to get you started with globs:

  • http://target/** matches all URLs that start with http://target/
  • http://target/api/** matches all URLs that start with http://target/api/
  • http://target/docs/* will match only files in the docs folder but not subfolders
  • http://target/docs/*.pdf will match only files with extension .pdf in the docs folder
  • *://target/** matches all URLs in the target hostname regardless of the protocol (i.e. http or https)

The following characters have a meaning in glob-style matching rules:

  • * matches zero or more characters in a single path portion
  • ** matches zero or more directories and subdirectories searching for matches

Keep in mind that the match is case-insensitive.

Regular Expressions

Regular Expressions are much more advanced then globs as you can define very complex patterns. Unlike globs, the regular expression must begin and end with backslash followed by an optional character defining a flag. Here are a few examples to get you started with regular expressions:

  • /^http://target/.*/ matches all URLs that start with http://target/
  • /^http://target/api/.*/ matches all URLs that start with http://target/api/
  • /^http://target/docs/.*.pdf/ will match only files with extension .pdf in that start with http://target/docs/
  • /^https?://target/.*/ matches all URLs in the target hostname regardless of the protocol (i.e. http or https)

The case-sensitivty can be turned off with the i flag. For example, the following expression is case-insensitive:

  • /^https?://target/docs.*/i matches all URLs in the docs folder in target hostname where DoCs, dOCS, Docs are also matched.