Nov 4 11:56:31 => Log Time Stamp
localhost => Hostname or IP address of HAProxy host
haproxy[24972] => Process ID for the HAProxy process
112.134.131.29:17817 => Source IP:Source Port
[04/Nov/2021:11:56:31.862] => Request Accepted timestamp
myservice => Front-end name
k8-sit-masters/k8-master => Target request was routed to
0/0/0/-1/0 => Time waiting for full request from client (ms) / Time waiting in queues (ms) / Time to establish connection to destination server (ms) / Time for destination server to send response (ms) / Total time request active in HAProxy (ms)
-1 => http status
0 => bytes read
- - => Pptional values (captured request cookie, captured response cookie)
SD-- => Termination state, cookie status
2/2/0/0/0 => Active connections / Front-end connections / Back-end connections / Server connections / Retries
0/0 => Server queue size / Back-end queue size
"POST /path/to/my/url HTTP/1.1" => Request method, API URL, http version
参考:HAProxy 日志定义
正如我们在日志中看到的http状态码是-1。-1 表示状态码不可用。原因在于终止标志字段。在您的情况下,终止标志值为 SD。这里
S => the TCP session was unexpectedly aborted by the server, or the
server explicitly refused it.
D => the session was killed by haproxy because the server was detected
as down and was configured to kill all connections when going down.