]> git.kaiwu.me - haproxy.git/commitdiff
DOC: vars: Add missing http/tcp-check part of the set-vars-from-map action
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Tue, 1 Dec 2026 14:30:47 +0000 (15:30 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Tue, 1 Dec 2026 14:34:02 +0000 (15:34 +0100)
This action can be used in both tcp-check and http-check rules but it
was never mentioned in the doc.

doc/configuration.txt

index 536457b005d40f4351b0cb4c0e10508698b77460..17903e527f0fa700c6444568a55641b3485d006e 100644 (file)
@@ -6621,6 +6621,7 @@ http-check expect                         X          -         X         X
 http-check send                           X          -         X         X
 http-check send-state                     X          -         X         X
 http-check set-var                        X          -         X         X
+http-check set-vars-from-map              X          -         X         X
 http-check unset-var                      X          -         X         X
 http-error                                X          X         X         X
 http-request                              X (!)      X         X         X
@@ -6739,6 +6740,7 @@ tcp-check send-lf                         X          -         X         X
 tcp-check send-binary                     X          -         X         X
 tcp-check send-binary-lf                  X          -         X         X
 tcp-check set-var                         X          -         X         X
+tcp-check set-vars-from-map               X          -         X         X
 tcp-check unset-var                       X          -         X         X
 tcp-request connection                    X (!)      X         X         -
 tcp-request content                       X (!)      X         X         X
@@ -9617,6 +9619,45 @@ http-check set-var-fmt(<var-name>[,<cond>...]) <fmt>
         http-check set-var-fmt(check.port) "name=%H"
 
 
+http-check set-vars-from-map(<scope>,<map-file>[,<type>])
+  This operation loads the two-column map file <map-file> and sets one variable
+  per entry. The first column of each entry holds the unqualified variable name
+  and the second column holds the value. For every entry, a variable named
+  "<scope>.<name>" is set, so all entries share the same <scope>. Only the
+  "sess" and "check" scopes are usable in check rules.
+
+  The optional <type> argument states how the values must be parsed. It
+  defaults to "str" and accepts:
+    - "str":  values are kept as strings, including any embedded space;
+    - "int":  values are parsed as strict integers, so that entries with
+              trailing garbage are rejected instead of being silently
+              truncated;
+    - "bool": values are parsed as booleans. The "true" and "false" spellings
+              are accepted in any case, as are the integers 0 and 1.
+
+  An entry whose name is not a valid variable name, or whose value cannot be
+  parsed with the requested <type>, is silently ignored. At most
+  "tune.vars.from-map.max" entries (100 by default) are processed per rule
+  evaluation.
+
+  The map file is loaded at configuration parsing time using the same mechanism
+  as the "map()" converter, so it may be shared with map lookups as long as it
+  is a two-column file. The current generation of entries is evaluated on every
+  check execution, so updates made through the stats socket are taken into
+  account.
+
+  May be used in the following contexts: tcp, http
+
+  May be used in sections:   defaults | frontend | listen | backend
+                               yes    |    no    |   yes  |   yes
+
+  Examples :
+        http-check set-vars-from-map(check,/etc/haproxy/check-vars.map)
+        http-check set-vars-from-map(check,/etc/haproxy/check-limits.map,int)
+
+  See also : "set-vars-from-map", "tune.vars.from-map.max"
+
+
 http-check unset-var(<var-name>)
   Free a reference to a variable within its scope.
 
@@ -15022,6 +15063,45 @@ tcp-check set-var-fmt(<var-name>[,<cond>...]) <fmt>
     tcp-check set-var-fmt(check.name) "%H"
 
 
+tcp-check set-vars-from-map(<scope>,<map-file>[,<type>])
+  This operation loads the two-column map file <map-file> and sets one variable
+  per entry. The first column of each entry holds the unqualified variable name
+  and the second column holds the value. For every entry, a variable named
+  "<scope>.<name>" is set, so all entries share the same <scope>. Only the
+  "sess" and "check" scopes are usable in check rules.
+
+  The optional <type> argument states how the values must be parsed. It
+  defaults to "str" and accepts:
+    - "str":  values are kept as strings, including any embedded space;
+    - "int":  values are parsed as strict integers, so that entries with
+              trailing garbage are rejected instead of being silently
+              truncated;
+    - "bool": values are parsed as booleans. The "true" and "false" spellings
+              are accepted in any case, as are the integers 0 and 1.
+
+  An entry whose name is not a valid variable name, or whose value cannot be
+  parsed with the requested <type>, is silently ignored. At most
+  "tune.vars.from-map.max" entries (100 by default) are processed per rule
+  evaluation.
+
+  The map file is loaded at configuration parsing time using the same mechanism
+  as the "map()" converter, so it may be shared with map lookups as long as it
+  is a two-column file. The current generation of entries is evaluated on every
+  check execution, so updates made through the stats socket are taken into
+  account.
+
+  May be used in the following contexts: tcp, http, log
+
+  May be used in sections:   defaults | frontend | listen | backend
+                               yes    |    no    |   yes  |   yes
+
+  Examples :
+    tcp-check set-vars-from-map(check,/etc/haproxy/check-vars.map)
+    tcp-check set-vars-from-map(check,/etc/haproxy/check-limits.map,int)
+
+  See also : "set-vars-from-map", "tune.vars.from-map.max"
+
+
 tcp-check unset-var(<var-name>)
   Free a reference to a variable within its scope.
 
@@ -35048,6 +35128,7 @@ http-check send [meth <method>] [{ uri <uri> | uri-lf <fmt> }>] [ver <version>]
 http-check send-state
 http-check set-var(<var-name>[,<cond>...]) <expr>
 http-check set-var-fmt(<var-name>[,<cond>...]) <fmt>
+http-check set-vars-from-map(<scope>,<map-file>[,<type>])
 http-check unset-var(<var-name>)
   Add a specific http-check rule for a "httpchk" healthcheck. The same syntax
   than the corresponding proxy's directives is used. See the corresponding proxy
@@ -35067,6 +35148,7 @@ tcp-check send-binary <hexstring> [comment <msg>]
 tcp-check send-binary-lf <hexfmt> [comment <msg>]
 tcp-check set-var(<var-name>[,<cond>...]) <expr>
 tcp-check set-var-fmt(<var-name>[,<cond>...]) <fmt>
+tcp-check set-vars-from-map(<scope>,<map-file>[,<type>])
 tcp-check unset-var(<var-name>)
   Add a specific tcp-check rule for a "tcp-check" healthcheck. The same syntax
   than the corresponding proxy's directives is used. See the corresponding proxy