envoyproxy/envoy

Access log status code filter not working for response code 0

Open

#17,482 opened on Jul 26, 2021

View on GitHub
 (3 comments) (0 reactions) (0 assignees)C++ (5,373 forks)batch import
area/access_logbughelp wanted

Repository metrics

Stars
 (27,997 stars)
PR merge metrics
 (Avg merge 8d) (378 merged PRs in 30d)

Description

Description: Unable to use status code filters to log requests with a 0 response code.

Repro steps: We are running Istio 1.6.13 which uses Envoy 1.15.4. We want to only output access logs for HTTP requests with responses >= 400 or == 0.

This is the filter being applied:

filter:
  or_filter:
    filters:
    - status_code_filter:
        comparison:
          op: GE
          value:
            default_value: "400"
            runtime_key: "400"
    - status_code_filter:
        comparison:
          op: EQ
          value:
            default_value: "0"
            runtime_key: "0"

All 4xx/5xx requests are being logged, and 1xx/2xx/3xx requests are not logged, as expected. However, any requests with response code 0 are also not being logged.

Has this been resolved in a newer version of Envoy/Istio?

If not:

  1. Is this the intended behaviour because the status code filter only gets applied to valid HTTP response codes?
  2. Is there a different filter that can be applied to make sure all 0 responses get logged?

Contributor guide