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

networkErrorFilter Filter

Select exchanges that fail due to a network error (connection refused, DNS failure, timeout) so you can log, retry-tag or alert on them.

networkErrorFilter selects exchanges that did not survive the trip to the upstream, whether because of a DNS failure, a refused TCP connection, a botched TLS handshake or a dropped connection. It is the right tool for building observability on top of unreliable upstreams without having to instrument the application itself.

When to use this filter

Reach for networkErrorFilter when a rule should only fire on exchanges that failed at the network layer. These are exchanges where Fluxzy could not complete the TCP connect, the DNS resolution failed, the TLS handshake errored out, or the upstream closed the connection unexpectedly.

Typical situations:

  • Logging every failed exchange to a dedicated file for offline triage.
  • Tagging network errors so they are easy to spot in the capture view.
  • Sending an alert via stdErrAction when a flaky upstream starts dropping connections.

The filter evaluates on the responseHeaderReceivedFromRemote scope, which is the moment Fluxzy decides whether a response will materialize or whether the exchange has effectively failed. It is the safety net for transport level failures.

Real world examples

Log every network error to a file

Append a line for each failed exchange to a dedicated log file so you can review the failure pattern later without scrolling through every exchange.

rules:
- filter:
    typeKind: NetworkErrorFilter
  actions:
  - typeKind: FileAppendAction
    filename: /var/log/fluxzy/network-errors.log
    text: "{{exchange.url}} {{exchange.id}}"

Tag failed exchanges for triage

Apply a tag to every network error so they group together in the Fluxzy capture view, making it easy to filter the failure set when reviewing a session.

rules:
- filter:
    typeKind: NetworkErrorFilter
  actions:
  - typeKind: ApplyTagAction
    tag:
      value: network-error

Print a warning to stderr on every connection failure

Stream a one line message to standard error each time an exchange fails, useful in CI runs or container logs where the operator should be alerted immediately.

rules:
- filter:
    typeKind: NetworkErrorFilter
  actions:
  - typeKind: StdErrAction
    text: "network error on {{exchange.url}}"

Reference

networkErrorFilter

Description

Select exchanges that fails due to network error.

Evaluation scope

Evaluation scope defines the timing where this filter will be applied.

responseHeaderReceivedFromRemote This scope occurs the moment fluxzy has done parsing the response header.

YAML configuration name

networkErrorFilter

Settings

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

Example of usage

The following examples apply a comment to the filtered exchange

Select exchanges that fails due to network error.

rules:
- filter:
    typeKind: NetworkErrorFilter
  actions:
  - typeKind: ApplyCommentAction
    comment: filter was applied

.NET reference

View definition of NetworkErrorFilter for .NET integration.

See also

This filter has no related filter

Frequently asked questions

What kind of failures does networkErrorFilter catch?

It catches transport level failures including DNS resolution errors, TCP connect failures, TLS handshake errors and unexpected connection resets that happen before a complete response is received.

Does it match HTTP 5xx responses from the upstream?

No. A 5xx response is a successful exchange from the network point of view, the upstream did send a response. Use statusCodeServerErrorFilter for application level errors and networkErrorFilter for transport level ones.

When is the filter evaluated?

On the responseHeaderReceivedFromRemote scope. The check happens at the moment Fluxzy decides whether the exchange produced a response or failed in transit.

Can I combine it with other filters?

Yes. Wrap networkErrorFilter inside a FilterCollection together with a hostFilter or pathFilter to scope the rule to failures on a specific endpoint.

Learn more about Fluxzy rules