-
Feature Request
-
Resolution: Done
-
Major
-
None
-
openshift-4.10
-
False
-
False
-
Undefined
-
-
-
-
1. Proposed title of this feature request
Capture multiple message-header fields with the same field-name
2. Feature Overview
With this feature it should be possible to capture multiple message-header fields with the same field-name. Currently only the first one is capture.
3. Why does the customer need this? (List the business requirements here)
In some HTTP message some headers could appear more then once. According to RFC-2616
Multiple message-header fields with the same field-name MAY be present in a message if and only if the entire field-value for that header field is defined as a comma-separated list [i.e., #(values)]. It MUST be possible to combine the multiple header fields into one "field-name: field-value" pair, without changing the semantics of the message, by appending each subsequent field-value to the first, each separated by a comma. The order in which header fields with the same field-name are received is therefore significant to the interpretation of the combined field value, and thus a proxy MUST NOT change the order of these field values when a message is forwarded.
In order to properly analyse and segregate logs my customer needs to manage headers that appear more than once in the message. When we try to capture different headers x-forwarded-for-$x for example only the first one is captured.
As a workaround we trie to specify different key for every single occurence of this header. Here after an example for multiple x-forwarded-for header.
{ "http": { "response": { "status_code": "%ST" }, "request": { "headers": { "host": "%[capture.req.hdr(0)]", "x-forwarded-for": "%[capture.req.hdr(1)]", "x-forwarded-for-1": "%[capture.req.hdr(5)]", "x-forwarded-for-2": "%[capture.req.hdr(6)]", "x-forwarded-host": "%[capture.req.hdr(2)]", "x-forwarded-proto": "%[capture.req.hdr(3)]", "x-forwarded-port": "%[capture.req.hdr(4)]" } } } }
It allow to capture but customer have to modify the way all the ecosystem works to add multiple differents headers and have to adapt HAProxy when a new one is added.
4. List any affected packages or components.
- Cluster-Ingress-Operator
- Openshift-Api
5. Documentation Considerations
Documentation should be updated accordingly but no new section should be required (Updates existing content, and Release Note)
- is cloned by
-
OCPBUGS-8351 Capture multiple message-header fields with the same field-name
- Closed
- relates to
-
OCPBUGS-8351 Capture multiple message-header fields with the same field-name
- Closed