Payload-To-Metadata Filter (proto)

This extension has the qualified name envoy.filters.thrift.payload_to_metadata

Note

This extension is functional but has not had substantial production burn time, use only with this caveat.

This extension is not hardened and should only be used in deployments where both the downstream and upstream are trusted.

Tip

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

This extension must be configured with one of the following type URLs:

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

Payload to Metadata configuration overview.

extensions.filters.network.thrift_proxy.filters.payload_to_metadata.v3.PayloadToMetadata

[extensions.filters.network.thrift_proxy.filters.payload_to_metadata.v3.PayloadToMetadata proto]

{
  "request_rules": []
}
request_rules

(repeated extensions.filters.network.thrift_proxy.filters.payload_to_metadata.v3.PayloadToMetadata.Rule, REQUIRED) The list of rules to apply to requests.

extensions.filters.network.thrift_proxy.filters.payload_to_metadata.v3.PayloadToMetadata.KeyValuePair

[extensions.filters.network.thrift_proxy.filters.payload_to_metadata.v3.PayloadToMetadata.KeyValuePair proto]

{
  "metadata_namespace": ...,
  "key": ...,
  "value": ...,
  "regex_value_rewrite": {...},
  "type": ...
}
metadata_namespace

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

key

(string, REQUIRED) The key to use within the namespace.

value

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

When used for on_present case, if value is non-empty it’ll be used instead of the field value. If both are empty, the field value is used as-is.

When used for on_missing case, a non-empty value must be provided.

Only one of value, regex_value_rewrite may be set.

regex_value_rewrite

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

This is only used for on_present.

Only one of value, regex_value_rewrite may be set.

type

(extensions.filters.network.thrift_proxy.filters.payload_to_metadata.v3.PayloadToMetadata.ValueType) The value’s type — defaults to string.

extensions.filters.network.thrift_proxy.filters.payload_to_metadata.v3.PayloadToMetadata.Rule

[extensions.filters.network.thrift_proxy.filters.payload_to_metadata.v3.PayloadToMetadata.Rule proto]

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

{
  "method_name": ...,
  "service_name": ...,
  "field_selector": {...},
  "on_present": {...},
  "on_missing": {...}
}
method_name

(string) If specified, the route must exactly match the request method name. As a special case, an empty string matches any request method name.

Precisely one of method_name, service_name must be set.

service_name

(string) If specified, the route must have the service name as the request method name prefix. As a special case, an empty string matches any service name. Only relevant when service multiplexing.

Precisely one of method_name, service_name must be set.

field_selector

(extensions.filters.network.thrift_proxy.filters.payload_to_metadata.v3.PayloadToMetadata.FieldSelector, REQUIRED) Specifies that a match will be performed on the value of a field.

on_present

(extensions.filters.network.thrift_proxy.filters.payload_to_metadata.v3.PayloadToMetadata.KeyValuePair) If the field is present, apply this metadata KeyValuePair.

on_missing

(extensions.filters.network.thrift_proxy.filters.payload_to_metadata.v3.PayloadToMetadata.KeyValuePair) If the field is missing, apply this metadata KeyValuePair.

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

extensions.filters.network.thrift_proxy.filters.payload_to_metadata.v3.PayloadToMetadata.FieldSelector

[extensions.filters.network.thrift_proxy.filters.payload_to_metadata.v3.PayloadToMetadata.FieldSelector proto]

{
  "name": ...,
  "id": ...,
  "child": {...}
}
name

(string, REQUIRED) field name to log

id

(int32) field id to match

child

(extensions.filters.network.thrift_proxy.filters.payload_to_metadata.v3.PayloadToMetadata.FieldSelector) next node of the field selector

Enum extensions.filters.network.thrift_proxy.filters.payload_to_metadata.v3.PayloadToMetadata.ValueType

[extensions.filters.network.thrift_proxy.filters.payload_to_metadata.v3.PayloadToMetadata.ValueType proto]

STRING

(DEFAULT)

NUMBER