Reference

show env

Display current load balancer process and environment information.

Description Jump to heading

Use show env to show environment variables and information from the running configuration.

Examples Jump to heading

Display all environment information Jump to heading

Query the Runtime API with show env to display environment information.

nix
echo "show env" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
nix
echo "show env" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
output
text
LANG=C.UTF-8
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
NOTIFY_SOCKET=/run/systemd/notify
INVOCATION_ID=7a7ca4b99e3b4b928a33151b92f10614
JOURNAL_STREAM=9:12696369
CONFIG=/etc/hapee-3.1/hapee-lb.cfg
PIDFILE=/run/hapee-3.1-lb.pid
OPTIONS=
HAPROXY_LOCALPEER=haproxy1
HAPROXY_CFGFILES=/etc/hapee-3.1/hapee-lb.cfg
HAPROXY_MWORKER=1
HAPROXY_CLI=unix@/var/run/hapee-3.1/hapee-lb.sock;sockpair@7
HAPROXY_MWORKER_REEXEC=1
output
text
LANG=C.UTF-8
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
NOTIFY_SOCKET=/run/systemd/notify
INVOCATION_ID=7a7ca4b99e3b4b928a33151b92f10614
JOURNAL_STREAM=9:12696369
CONFIG=/etc/hapee-3.1/hapee-lb.cfg
PIDFILE=/run/hapee-3.1-lb.pid
OPTIONS=
HAPROXY_LOCALPEER=haproxy1
HAPROXY_CFGFILES=/etc/hapee-3.1/hapee-lb.cfg
HAPROXY_MWORKER=1
HAPROXY_CLI=unix@/var/run/hapee-3.1/hapee-lb.sock;sockpair@7
HAPROXY_MWORKER_REEXEC=1

Display only one environment variable’s information Jump to heading

Available since

  • HAProxy 3.1
  • HAProxy Enterprise 3.1

Provide the name of a specific environment variable to the show env command to show only that environment variable. Here we retrieve HAPROXY_UID:

nix
echo "show env HAPROXY_UID" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
nix
echo "show env HAPROXY_UID" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
output
text
HAPROXY_UID=haproxy
output
text
HAPROXY_UID=haproxy

See also Jump to heading

Do you have any suggestions on how we can improve the content of this page?