queryStringFilter brings query parameter awareness into a Fluxzy rule without forcing you to write a full URL regex. Combine it with header, path or host filters inside a filterCollection when you need precise multi component scoping.
Use queryStringFilter when the meaningful selector for your rule lives in the URL query rather than in the path or host. The filter accepts a parameter name, a value pattern and one of several search operations, which makes it precise enough for both exact matches and regex driven detection.
Typical situations:
tenant= query parameter.?debug=true and reacting to them.If you do not provide a name, every query value is searched and the filter matches when at least one value satisfies the pattern. The filter runs on the requestHeaderReceivedFromClient scope so the URL is already fully parsed.
Apply a tag to any request where the tenant query parameter equals the customer you are investigating, so you can pivot the timeline by tenant.
rules:
- filter:
typeKind: QueryStringFilter
name: tenant
pattern: acme-corp
operation: Exact
actions:
- typeKind: ApplyTagAction
tag:
value: tenant-acme
Detect a debug toggle in the URL and forward it to the backend as a header so the server can switch on verbose logging without changing the client code.
rules:
- filter:
typeKind: QueryStringFilter
name: debug
pattern: 'true'
operation: Exact
caseSensitive: false
actions:
- typeKind: AddRequestHeaderAction
headerName: X-Debug-Mode
headerValue: '1'
Block any exchange that exposes a bearer token through a query parameter, a common anti pattern that should never reach production.
rules:
- filter:
typeKind: QueryStringFilter
name: access_token
pattern: .+
operation: Regex
actions:
- typeKind: RejectWithStatusCodeAction
statusCode: 400
Select exchanges containing a specific query string. If name is not defined or empty, the search will be performed on any query string values.The search will pass if at least one value match.
Evaluation scope defines the timing where this filter will be applied.
requestHeaderReceivedFromClient This scope occurs the moment fluxzy parsed the request header receiveid from client
queryStringFilter
The following table describes the customizable properties available for this filter:
| Property | Type | Description | DefaultValue |
|---|---|---|---|
| name | string | The query string name | |
| pattern | string | The string pattern to search | |
| operation | exact | contains | startsWith | endsWith | regex | The search operation performed | exact |
| caseSensitive | boolean | true if the Search should be case sensitive | false |
| inverted | boolean | Negate the filter result | false |
The following examples apply a comment to the filtered exchange
Select exchanges having query string id=123456.
rules:
- filter:
typeKind: QueryStringFilter
name: id
pattern: 123456
operation: Exact
actions:
- typeKind: ApplyCommentAction
comment: filter was applied
View definition of QueryStringFilter for .NET integration.
The following filters are related to this filter:
The filter searches every query value. It matches as soon as at least one value satisfies the pattern, which is convenient for global checks across all parameters.
Exact, Contains, StartsWith, EndsWith and Regex. The default is Exact when matching by name, which is the safest choice for parameter values.
No by default. Set caseSensitive: true to enforce case sensitivity, useful when the value is a base64 token or another identifier where case carries meaning.
Yes, set inverted: true. The rule then matches any exchange whose query string does not satisfy the pattern, including requests that omit the parameter entirely.