Reference

show events

Available since

  • HAProxy 2.0
  • HAProxy Enterprise 2.0r1

Show events from a running trace.

Description Jump to heading

If you set a trace’s sink to buf0, it records the events in a ring buffer stored inside the load balancer’s memory, which you can then access using the show events command.

When calling the Runtime API in an interactive session via the prompt command, you can pass the -w flag to wait for events and/or the -n flag to skip ahead to see only new events.

Examples Jump to heading

To show events that you’ve captured in the buffer, follow these steps:

  1. Start a trace, such as with the following commands. Note that the sink is set to buf0 to record events in a ring buffer:

    nix
    echo "trace h1 event +any; trace h1 level user; trace h1 verbosity simple; trace h1 sink buf0; trace h1 start now" | \
    sudo socat stdio tcp4-connect:127.0.0.1:9999
    nix
    echo "trace h1 event +any; trace h1 level user; trace h1 verbosity simple; trace h1 sink buf0; trace h1 start now" | \
    sudo socat stdio tcp4-connect:127.0.0.1:9999
  2. Call show events to display recorded events:

    nix
    echo "show events buf0" | \
    sudo socat stdio tcp4-connect:127.0.0.1:9999
    nix
    echo "show events buf0" | \
    sudo socat stdio tcp4-connect:127.0.0.1:9999
    output
    text
    <0>2021-02-22T16:44:21.014274+00:00 [00|h1|0|mux_h1.c:1459] rcvd H1 request headers : [F] [MSG_DONE, MSG_RPBEFORE] - "GET / HTTP/1.1" - h1c=0x5617388cd310(0x00000000) h1s=0x5617388cd620(0x00000010)
    <0>2021-02-22T16:44:21.017431+00:00 [00|h1|0|mux_h1.c:1492] H1 request fully rcvd : [F] [MSG_DONE, MSG_RPBEFORE] - "GET / HTTP/1.1" - h1c=0x5617388cd310(0x00000000) h1s=0x5617388cd620(0x00000410)
    <0>2021-02-22T16:44:21.017963+00:00 [00|h1|0|mux_h1.c:1683] sending request headers : [B] [MSG_RQBEFORE, MSG_RPBEFORE] - "GET / HTTP/1.1" - h1c=0x5617388f22a0(0x00000000) h1s=0x5617388f2450(0x00000010)
    <0>2021-02-22T16:44:21.017973+00:00 [00|h1|0|mux_h1.c:1955] H1 request fully xferred : [B] [MSG_DONE, MSG_RPBEFORE] - h1c=0x5617388f22a0(0x00000000) h1s=0x5617388f2450(0x00004010)
    <0>2021-02-22T16:44:21.024810+00:00 [00|h1|0|mux_h1.c:1459] rcvd H1 response headers : [B] [MSG_DONE, MSG_DATA] - "HTTP/1.1 200 OK" - h1c=0x5617388f22a0(0x00000000) h1s=0x5617388f2450(0x00004010)
    <0>2021-02-22T16:44:21.024822+00:00 [00|h1|0|mux_h1.c:1492] H1 response fully rcvd : [B] [MSG_DONE, MSG_DONE] - "HTTP/1.1 200 OK" - h1c=0x5617388f22a0(0x00000000) h1s=0x5617388f2450(0x00004410)
    <0>2021-02-22T16:44:21.024844+00:00 [00|h1|0|mux_h1.c:1698] sending response headers : [F] [MSG_DONE, MSG_RPBEFORE] - "HTTP/1.1 200 OK" - h1c=0x5617388cd310(0x00000040) h1s=0x5617388cd620(0x00000410)
    <0>2021-02-22T16:44:21.024855+00:00 [00|h1|0|mux_h1.c:1955] H1 response fully xferred : [F] [MSG_DONE, MSG_DONE] - h1c=0x5617388cd310(0x00000000) h1s=0x5617388cd620(0x00004410)
    output
    text
    <0>2021-02-22T16:44:21.014274+00:00 [00|h1|0|mux_h1.c:1459] rcvd H1 request headers : [F] [MSG_DONE, MSG_RPBEFORE] - "GET / HTTP/1.1" - h1c=0x5617388cd310(0x00000000) h1s=0x5617388cd620(0x00000010)
    <0>2021-02-22T16:44:21.017431+00:00 [00|h1|0|mux_h1.c:1492] H1 request fully rcvd : [F] [MSG_DONE, MSG_RPBEFORE] - "GET / HTTP/1.1" - h1c=0x5617388cd310(0x00000000) h1s=0x5617388cd620(0x00000410)
    <0>2021-02-22T16:44:21.017963+00:00 [00|h1|0|mux_h1.c:1683] sending request headers : [B] [MSG_RQBEFORE, MSG_RPBEFORE] - "GET / HTTP/1.1" - h1c=0x5617388f22a0(0x00000000) h1s=0x5617388f2450(0x00000010)
    <0>2021-02-22T16:44:21.017973+00:00 [00|h1|0|mux_h1.c:1955] H1 request fully xferred : [B] [MSG_DONE, MSG_RPBEFORE] - h1c=0x5617388f22a0(0x00000000) h1s=0x5617388f2450(0x00004010)
    <0>2021-02-22T16:44:21.024810+00:00 [00|h1|0|mux_h1.c:1459] rcvd H1 response headers : [B] [MSG_DONE, MSG_DATA] - "HTTP/1.1 200 OK" - h1c=0x5617388f22a0(0x00000000) h1s=0x5617388f2450(0x00004010)
    <0>2021-02-22T16:44:21.024822+00:00 [00|h1|0|mux_h1.c:1492] H1 response fully rcvd : [B] [MSG_DONE, MSG_DONE] - "HTTP/1.1 200 OK" - h1c=0x5617388f22a0(0x00000000) h1s=0x5617388f2450(0x00004410)
    <0>2021-02-22T16:44:21.024844+00:00 [00|h1|0|mux_h1.c:1698] sending response headers : [F] [MSG_DONE, MSG_RPBEFORE] - "HTTP/1.1 200 OK" - h1c=0x5617388cd310(0x00000040) h1s=0x5617388cd620(0x00000410)
    <0>2021-02-22T16:44:21.024855+00:00 [00|h1|0|mux_h1.c:1955] H1 response fully xferred : [F] [MSG_DONE, MSG_DONE] - h1c=0x5617388cd310(0x00000000) h1s=0x5617388cd620(0x00004410)

See also Jump to heading

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