Hello haproxy Team.

I made new patches for
https://www.mail-archive.com/[email protected]&q=subject:%22%5C%5BRFC%5C%5D+dump_all_vars%5C%28%5C%29+implementation+%5C%28issue+%231623%5C%29%22&o=newest

and it is divided into three patches below.

The first patch adds settings without affecting existing functionality.
Second patch actually adds the dump_all_vars() function.
Finally, the last part involves Doc-related settings.

Since this was my first time working on it, it took some time to understand
the structure and make adjustments, and the code may not be perfect yet.
So feedback me please.

Thank you for always striving to provide excellent haproxy service.
Hyeonggeun Oh (github username Geun-Oh)

On Fri, Nov 7, 2025 at 4:22 PM Hyeonggeun Oh <[email protected]>
wrote:

> Add documentation for the dump_all_vars() sample fetch function in the
> configuration manual. This function was introduced in the previous commit
> to dump all variables in a given scope with optional prefix filtering.
>
> The documentation includes:
> - Function signature and return type
> - Description of output format
> - Explanation of scope and prefix arguments
> - Usage examples for common scenarios
>
> This completes the implementation of GitHub issue #1623.
> ---
>  doc/configuration.txt | 29 +++++++++++++++++++++++++++++
>  1 file changed, 29 insertions(+)
>
> diff --git a/doc/configuration.txt b/doc/configuration.txt
> index 43f25a8c7..263382685 100644
> --- a/doc/configuration.txt
> +++ b/doc/configuration.txt
> @@ -22928,6 +22928,35 @@ var(<var-name>[,<default>]) : undefined
>    return it as a string. Empty strings are permitted. See section 2.8
> about
>    variables for details.
>
> +dump_all_vars([<scope>][,<prefix>]) : string
> +  Returns a comma-separated list of all variables in the specified scope,
> +  optionally filtered by name prefix. The output format is:
> +  var1=value1, var2=value2, ...
> +
> +  String values are quoted and special characters are escaped (", \, \r,
> \n,
> +  \b, \0). All sample types are supported and automatically converted to
> +  strings.
> +
> +  The <scope> argument is optional and can be one of: sess, txn, req, res,
> +  proc. If omitted, the scope is determined by the context (txn for
> streams,
> +  sess for sessions, proc otherwise).
> +
> +  The <prefix> argument is optional and filters variables whose names
> start
> +  with the specified prefix (after removing the scope prefix).
> +
> +  This is particularly useful for debugging, logging, or exporting
> variable
> +  states.
> +
> +  Examples:
> +    # Dump all transaction variables
> +    http-request return string %[dump_all_vars(txn)]
> +
> +    # Dump only variables starting with "user"
> +    http-request set-header X-User-Vars "%[dump_all_vars(txn,user)]"
> +
> +    # Dump all process variables
> +    http-request return string %[dump_all_vars(proc)]
> +
>  wait_end : boolean
>    This fetch either returns true when the inspection period is over, or
> does
>    not fetch. It is only used in ACLs, in conjunction with content
> analysis to
> --
> 2.50.1 (Apple Git-155)
>
>

Reply via email to