Hi,
I’m looking for way to see server ip-address that HAPROXY learned during start process. I didn’t managed to find easy method to do it. May be someone faced such issue?
Ex:
server SRV1 serv.example.loc check …
How to see SRV1 ip-addr
Thanks!
Hi,
I’m looking for way to see server ip-address that HAPROXY learned during start process. I didn’t managed to find easy method to do it. May be someone faced such issue?
Ex:
server SRV1 serv.example.loc check …
How to see SRV1 ip-addr
Thanks!
I had similar use case, to find the backend server IP. the way i solved it by custom logformat. By default haproxy logs clientIP & client port, so instead i used this, taken from https://cbonte.github.io/haproxy-dconv/1.8/configuration.html#8.2.4
At the moment, the default HTTP format is defined this way :
log-format "%si:%sp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC \
%CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r"
change is %si:%sp
instead of %ci:%cp. Even though my backend mode was http
with si, i was able to get the serverIP that served the request. Hope this helps.
ykiran_k, thanks for reply. Currently I use similar solution. My customised log is:
log-format "%ci:%cp --> %fi:%fp %b/%s %bi:%bp --> %si:%sp %Tw/%Tc/%Tt in:%U/out:%B sess_start:%t %ts %ac/%fc/%bc/%sc/%rc %sq/%bq"
HAPROXY gives flexible log customisation tools, but I meant how to see servers’ ip-addresses on stats page or with “show stats”. Is it possible?
Use show servers state on the admin socket.
Enable the stats show-legends option to see the IPs on the stats page. It will appear as a popup when you move your cursor over the server name.