Header-To-Metadata Filter

    As of Envoy v1.18 the v2 API has been removed and is no longer supported.

    If you are upgrading from v2 API config you may wish to view the v2 API documentation:

    This extension may be referenced by the qualified name

    Note

    This extension is intended to be robust against untrusted downstream traffic. It assumes that the upstream is trusted.

    Tip

    This extension extends and can be used with the following extension category:

    The configuration for transforming headers into metadata. This is useful for matching load balancer subsets, logging, etc.

    Header to Metadata configuration overview.

    request_rules

    (repeated extensions.filters.http.header_to_metadata.v3.Config.Rule) The list of rules to apply to requests.

    response_rules

    (repeated ) The list of rules to apply to responses.

    [extensions.filters.http.header_to_metadata.v3.Config.KeyValuePair proto]

    metadata_namespace

    () The namespace — if this is empty, the filter’s namespace will be used.

    key

    value

    (string) The value to pair with the given key.

    When used for a case, if value is non-empty it’ll be used instead of the header value. If both are empty, no metadata is added.

    When used for a on_header_missing case, a non-empty value must be provided otherwise no metadata is added.

    regex_value_rewrite

    () If present, the header’s value will be matched and substituted with this. If there is no match or substitution, the header value is used as-is.

    This is only used for on_header_present.

    Note: if the value field is non-empty this field should be empty.

    type

    () The value’s type — defaults to string.

    encode

    (extensions.filters.http.header_to_metadata.v3.Config.ValueEncode) How is the value encoded, default is NONE (not encoded). The value will be decoded accordingly before storing to metadata.

    A Rule defines what metadata to apply when a header is present or missing.

    header

    (string) Specifies that a match will be performed on the value of a header or a cookie.

    The header to be extracted.

    cookie

    () The cookie to be extracted.

    (extensions.filters.http.header_to_metadata.v3.Config.KeyValuePair) If the header or cookie is present, apply this metadata KeyValuePair.

    If the value in the KeyValuePair is non-empty, it’ll be used instead of the header or cookie value.

    on_header_missing

    () If the header or cookie is not present, apply this metadata KeyValuePair.

    The value in the KeyValuePair must be set, since it’ll be used in lieu of the missing header or cookie value.

    remove

    (bool) Whether or not to remove the header after a rule is applied.

    This prevents headers from leaking. This field is not supported in case of a cookie.

    STRING

    (DEFAULT)

    NUMBER

    PROTOBUF_VALUE

    ⁣The value is a serialized protobuf.Value.

    ValueEncode defines the encoding algorithm.

    NONE

    (DEFAULT) ⁣The value is not encoded.

    ⁣The value is encoded in Base64. Note: this is mostly used for STRING and PROTOBUF_VALUE to escape the non-ASCII characters in the header.