Skip to content

Filters

When matching based on request or response attributes (not just the URL), you can use filters to achieve more granular rule control. The syntax is:

txt
pattern operator includeFilter://pattern1 ... excludeFilter://patternx ...

Multiple filters are matched "or"; as long as one of the filter conditions matches, the match is true.

Filter Types

Filter TypeSyntaxPurpose
Include FilterincludeFilter://patternMatch only requests that match the specified conditions
Exclude FilterexcludeFilter://patternExclude requests that match the specified conditions

Pattern Types

SyntaxPurposeExample
b:patternMatch request body contentincludeFilter://b:keyword excludeFilter://b:/regexp/[i]
m:patternMatch HTTP methodincludeFilter://m:keyword excludeFilter://m:/regexp/[i]
i:patternMatch client or server IPincludeFilter://i:keyword excludeFilter://i:/regexp/[i]
chance:probabilityMath.random() < probabilityincludeFilter://chance:0.5 excludeFilter://chance:0.3
clientIp:patternMatch only client IPincludeFilter://clientIp:/regexp/[i] excludeFilter://clientIp:keyword
serverIp:patternMatch only server IPincludeFilter://serverIp:/regexp/[i] excludeFilter://serverIp:keyword
s:patternMatch response status codeincludeFilter://s:/^20/ excludeFilter://s:30
reqH.header-key:patternMatch request headers onlyincludeFilter://reqH.content-type:json excludeFilter://reqH.content-type:/regexp/i
resH.header-key:patternMatch response headers onlyincludeFilter://resH.content-type:json excludeFilter://resH.content-type:/regexp/i
Other xxxxxxMatch request URLs (same as pattern)includeFilter://*/cgi-* excludeFilter://www.test.com includeFilter://https://www.test.com/path