New Transparent capture is in preview. Record every app's traffic with no proxy configuration, on Windows, macOS and Linux. Learn more

queryStringFilter Filter

Select exchanges by query string name and value with exact, contains, prefix, suffix or regex matching, plus optional case sensitivity.

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.

When to use this filter

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:

  • Targeting one tenant by inspecting a tenant= query parameter.
  • Detecting feature flag values such as ?debug=true and reacting to them.
  • Stripping tracking parameters by matching them before deleting or rewriting the request.

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.

Real world examples

Tag exchanges for a specific tenant

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

Inject a debug header when ?debug=true is present

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'

Reject requests carrying a sensitive token in the URL

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

Reference

queryStringFilter

Description

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

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

YAML configuration name

queryStringFilter

Settings

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

Example of usage

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

.NET reference

View definition of QueryStringFilter for .NET integration.

See also

The following filters are related to this filter:

Frequently asked questions

What happens when name is not provided?

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.

Which search operations are supported?

Exact, Contains, StartsWith, EndsWith and Regex. The default is Exact when matching by name, which is the safest choice for parameter values.

Is the match case sensitive?

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.

Can I select requests that do not carry the parameter?

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.

Learn more about Fluxzy rules