.. _envoy_v3_api_file_envoy/config/core/v3/substitution_format_string.proto: Substitution format string ========================== .. _envoy_v3_api_msg_config.core.v3.SubstitutionFormatString: config.core.v3.SubstitutionFormatString --------------------------------------- `[config.core.v3.SubstitutionFormatString proto] `_ Configuration to use multiple :ref:`command operators ` to generate a new string in either plain text or JSON format. .. code-block:: json { "text_format": "...", "json_format": "{...}" } .. _envoy_v3_api_field_config.core.v3.SubstitutionFormatString.text_format: text_format (`string `_) Specify a format with command operators to form a text string. Its details is described in :ref:`format string`. .. code-block:: text_format: %LOCAL_REPLY_BODY%:%RESPONSE_CODE%:path=$REQ(:path)% The following plain text will be created: .. code-block:: upstream connect error:204:path=/foo Precisely one of :ref:`text_format `, :ref:`json_format ` must be set. .. _envoy_v3_api_field_config.core.v3.SubstitutionFormatString.json_format: json_format (`Struct `_) Specify a format with command operators to form a JSON string. Its details is described in :ref:`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. .. code-block:: json_format: status: %RESPONSE_CODE% message: %LOCAL_REPLY_BODY% The following JSON object would be created: .. code-block:: json { "status": 500, "message": "My error message" } Precisely one of :ref:`text_format `, :ref:`json_format ` must be set.