Hướng Dẫn Cấu Hình Log Format Trong HAProxy
PreviousCấu Hình và Tính Năng Nổi BậtNextHướng dẫn chi tiết về cấu hình HAProxy cho Load Balancing và giới hạn tốc độ
Last updated
<timestamp> <client_ip>:<client_port> <backend_name>/<server_name> <http_method> <request_path> <http_version> <response_status> <bytes_sent> <time_taken>Nov 02 10:00:00 localhost haproxy[1234]: 192.168.1.100:12345 [02/Nov/2024:10:00:00.123] frontend_name backend_name/server_name 200 12345 30 0.123defaults
log global
option httplog
log-format "%ci:%cp [%t] %f %b/%s %Tq/%Tw/%Tc/%Tr/%Tt %ST %B %s"frontend http_front
log-format '{"time": "%t", "client_ip": "%ci", "client_port": "%cp", "backend": "%b", "server": "%s", "status": "%ST", "bytes": "%B", "time_taken": "%Tt"}'
option httplog{"time": "02/Nov/2024:10:00:00.123", "client_ip": "192.168.1.100", "client_port": "12345", "backend": "backend_name", "server": "server_name", "status": "200", "bytes": "12345", "time_taken": "0.123"}