Filters URLs for various criteria. See event filtering. All criteria are case sensitive.

interface UrlFilter {
    hostContains?: string;
    hostEquals?: string;
    hostPrefix?: string;
    hostSuffix?: string;
    originAndPathMatches?: string;
    pathContains?: string;
    pathEquals?: string;
    pathPrefix?: string;
    pathSuffix?: string;
    ports?: (number | [number, number])[];
    queryContains?: string;
    queryEquals?: string;
    queryPrefix?: string;
    querySuffix?: string;
    schemes?: string[];
    urlContains?: string;
    urlEquals?: string;
    urlMatches?: string;
    urlPrefix?: string;
    urlSuffix?: string;
}
Index
hostContains?: string

Matches if the host name of the URL contains a specified string. To test whether a host name component has a prefix 'foo', use hostContains: '.foo'. This matches 'www.foobar.com' and 'foo.com', because an implicit dot is added at the beginning of the host name. Similarly, hostContains can be used to match against component suffix ('foo.') and to exactly match against components ('.foo.'). Suffix- and exact-matching for the last components need to be done separately using hostSuffix, because no implicit dot is added at the end of the host name.

hostEquals?: string

Matches if the host name of the URL is equal to a specified string.

hostPrefix?: string

Matches if the host name of the URL starts with a specified string.

hostSuffix?: string

Matches if the host name of the URL ends with a specified string.

originAndPathMatches?: string

Matches if the URL without query segment and fragment identifier matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the RE2 syntax.

pathContains?: string

Matches if the path segment of the URL contains a specified string.

pathEquals?: string

Matches if the path segment of the URL is equal to a specified string.

pathPrefix?: string

Matches if the path segment of the URL starts with a specified string.

pathSuffix?: string

Matches if the path segment of the URL ends with a specified string.

ports?: (number | [number, number])[]

Matches if the port of the URL is contained in any of the specified port lists. For example [80, 443, [1000, 1200]] matches all requests on port 80, 443 and in the range 1000-1200.

queryContains?: string

Matches if the query segment of the URL contains a specified string.

queryEquals?: string

Matches if the query segment of the URL is equal to a specified string.

queryPrefix?: string

Matches if the query segment of the URL starts with a specified string.

querySuffix?: string

Matches if the query segment of the URL ends with a specified string.

schemes?: string[]

Matches if the scheme of the URL is equal to any of the schemes specified in the array.

urlContains?: string

Matches if the URL (without fragment identifier) contains a specified string. Port numbers are stripped from the URL if they match the default port number.

urlEquals?: string

Matches if the URL (without fragment identifier) is equal to a specified string. Port numbers are stripped from the URL if they match the default port number.

urlMatches?: string

Matches if the URL (without fragment identifier) matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the RE2 syntax.

urlPrefix?: string

Matches if the URL (without fragment identifier) starts with a specified string. Port numbers are stripped from the URL if they match the default port number.

urlSuffix?: string

Matches if the URL (without fragment identifier) ends with a specified string. Port numbers are stripped from the URL if they match the default port number.