getFilter is one of the most common building blocks in a Fluxzy rule file. It is the verb you reach for when you want to attach cache, header or tagging behavior to read traffic without worrying about writes.
Use getFilter when a rule should apply only to HTTP GET requests. GET dominates web traffic and is the safe, idempotent verb for read operations, so it is often the right scope for cache, observability and header actions.
Typical situations:
The filter evaluates on the requestHeaderReceivedFromClient scope. It is equivalent to a methodFilter configured for GET, but reads more clearly in rule files that talk in REST verbs.
Remove cache control headers from GET requests to the API to make sure the browser fetches a fresh copy on every page load.
rules:
- filter:
typeKind: FilterCollection
operation: and
children:
- typeKind: HostFilter
pattern: api.example.com
operation: Exact
- typeKind: GetFilter
actions:
- typeKind: RemoveCacheAction
Inject a tracing header on every GET request to the backend so server side logs can correlate the read with the active investigation.
rules:
- filter:
typeKind: FilterCollection
operation: and
children:
- typeKind: HostFilter
pattern: api.example.com
operation: Exact
- typeKind: GetFilter
actions:
- typeKind: AddRequestHeaderAction
headerName: X-Trace
headerValue: investigation-742
Tag every GET in the capture so a session report can split read versus write traffic and verify the expected ratio.
rules:
- filter:
typeKind: GetFilter
actions:
- typeKind: ApplyTagAction
tag:
value: read-traffic
Select exchanges with GET method
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
getFilter
This filter has no specific characteristic
The following table describes the customizable properties available for this filter:
| Property | Type | Description | DefaultValue |
|---|---|---|---|
| inverted | boolean | Negate the filter result | false |
The following examples apply a comment to the filtered exchange
Select exchanges with GET method.
rules:
- filter:
typeKind: GetFilter
actions:
- typeKind: ApplyCommentAction
comment: filter was applied
View definition of GetFilter for .NET integration.
The following filters are related to this filter:
Both work. getFilter is a shorthand that makes rule files easier to read when the intent is verb specific. Use methodFilter when the method is parametrized or when you need a regex over verbs.
No. getFilter matches GET only. HEAD is a different HTTP method even though it shares semantics.
Yes. Set inverted: true to select every exchange whose method is not GET, that is convenient when you want to act on write traffic only.
No. It only checks the method. Combine it with pathFilter or hostFilter when you need to constrain the target as well.