Substitution format string

config.core.v3.SubstitutionFormatString

[config.core.v3.SubstitutionFormatString proto]

Configuration to use multiple command operators to generate a new string in either plain text or JSON format.

{
  "text_format": "...",
  "json_format": "{...}"
}
text_format

(string) Specify a format with command operators to form a text string. Its details is described in format string.

text_format: %LOCAL_REPLY_BODY%:%RESPONSE_CODE%:path=$REQ(:path)%

The following plain text will be created:

upstream connect error:204:path=/foo

Precisely one of text_format, json_format must be set.

json_format

(Struct) Specify a format with command operators to form a JSON string. Its details is described in format dictionary. Values are rendered as strings, numbers, or boolean values as appropriate. Nested JSON objects may be produced by some command operators (e.g. FILTER_STATE or DYNAMIC_METADATA). See the documentation for a specific command operator for details.

json_format:
  status: %RESPONSE_CODE%
  message: %LOCAL_REPLY_BODY%

The following JSON object would be created:

{
  "status": 500,
  "message": "My error message"
}

Precisely one of text_format, json_format must be set.