Network ✓ fields verified against sample logs

HAProxy HTTP Log Format: Fields, Timers and Termination States

Published

One syslog line per HTTP request in the format "option httplog" produces: the client address and port, the time the request arrived, the frontend, the backend and server chosen, five timers, the status and bytes sent, a four-letter termination state, connection counts, queues, and the request line.

Official documentation: HAProxy: Configuration manual, 8.2.3 HTTP log format · HAProxy: Configuration manual, 8.5 Session state at disconnection

Sample record

Jan 15 09:00:01 lb-01 haproxy[1234]: 203.0.113.10:52001 [15/Jan/2024:09:00:01.000] frontend-https backend-api/app-01 1/0/3/45/49 200 8192 - - ---- 10/10/5/2/0 0/0 "GET /api/v1/dashboard HTTP/1.1"

From the LogTriage parser test corpus — synthetic data, no real hosts or users.

Explain this record field by field →

Field reference

Field Type Meaning Why it matters for security
client_ip:client_porte.g. 185.220.101.42:55001 address:port HAProxy: the IP address and TCP port "of the client which initiated the TCP connection to HAProxy". With accept-proxy on the bind line, the address from the PROXY protocol header. Behind a CDN or another load balancer this is that device; capture X-Forwarded-For to see the client.
request_datee.g. 15/Jan/2024:14:30:05.120 [DD/Mon/YYYY:HH:MM:SS.mmm] HAProxy: "the exact date when the first byte of the HTTP request was received by HAProxy", to the millisecond. The syslog header time is when the line was written, at the end of the request; this one is when it started.
frontend_namee.g. frontend-https string HAProxy: "the name of the frontend (or listener) which received and processed the connection." Separates public listeners from internal ones on a shared proxy.
backend_name/server_namee.g. frontend-https/<NOSRV> string The backend that handled the request and the last server it was sent to. <NOSRV> means no server was chosen: HAProxy answered itself (a deny, a redirect, an error) or the request never got that far. <NOSRV> with a 403 is a request your own http-request deny rules stopped.
TR/Tw/Tc/Tr/Tae.g. 0/-1/-1/-1/0 milliseconds Five timers: time to receive the full request (TR), waiting in queues (Tw), connecting to the server (Tc), waiting for the server's response headers (Tr) and the total time the request was active (Ta). -1 means that step was never reached. A large TR is a slow client (slowloris-style); a large Tr is a slow application, often an expensive endpoint being abused.
status_codee.g. 401 number HAProxy: "the HTTP status code returned to the client" — from the server, or generated by HAProxy itself. Bursts of 401/403 per client are guessing or probing; read termination_state to know who answered.
bytes_reade.g. 524288 number HAProxy: "the total number of bytes transmitted to the client when the log is emitted". Despite the name, it is what was sent to the client, headers included. Sum per client and path to spot bulk downloads and exports.
termination_statee.g. PR-- four characters Four letters: the first event that ended the session (C client abort, S server, P proxy, L local, R resource, I internal, D/U/K killed, c/s timeouts, - normal), the state it was in (R request, Q queue, C connect, H headers, D data, L last, T tarpit, - normal), then two persistence-cookie flags. PR = blocked by a deny rule or invalid request; PT = tarpitted; CD/cD = client gave up mid-transfer; SH = the server failed before answering.
actconn/feconn/beconn/srv_conn/retriese.g. 54/54/0/0/0 five numbers Concurrent connections on the whole process, on the frontend, on the backend and on the server when the line was logged, and the number of connection retries. A sudden rise in feconn from a few clients is a flood or a scanner opening many connections.
srv_queue/backend_queuee.g. 0/0 two numbers Requests processed before this one in the server queue and in the backend's queue. Non-zero queues during an attack mean the backend is saturated.
http_requeste.g. GET /.env HTTP/1.1 quoted string HAProxy: "the complete HTTP request line, including the method, request and HTTP version string", always the last field. Probes for /.env, /.git, admin panels and traversal payloads show here.

Have one of your own records? Paste it into the log line explainer and each field is explained from this table, with times, codes and addresses decoded — in your browser.

What it records

With option httplog, HAProxy writes one line per HTTP request, normally when the request ends, in the field order of section 8.2.3 of the configuration manual. The manual gives its exact definition as the log format string %ci:%cp [%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: client, request time, frontend, backend and server, the timers, status and bytes, captured cookies, the termination state, connection and queue counts, any captured headers in braces, and the quoted request line.

Because HAProxy sits in front of the application, its log also records what never reached a server: requests a deny rule refused (<NOSRV>, PR--), clients that timed out sending their request (cR--), and requests held in a tarpit (PT--). The application’s own access log cannot show any of those.

The malicious sample has one address requesting /admin/config and /admin/users (403 from the application), another posting to the login API (401) and then pulling a half-megabyte export (Tr 890 ms), and the first address again asking for /.env, which an HAProxy deny rule refused before any server saw it.

Where to get it

  • Syslog. HAProxy sends to the log target in the global or defaults section — usually the local syslog daemon (log /dev/log local0) or a remote collector; there is no log file of its own.
  • Containers. log stdout format raw local0 writes lines to standard output for Docker and Kubernetes.
  • Custom formats. log-format can add fields (TLS version, the unique ID, captured headers); the manual’s HTTPS format appends TLS details at the end.
# Requests HAProxy denied itself, per client
grep ' PR-- ' haproxy.log | awk '{print $6}' | cut -d: -f1 | sort | uniq -c | sort -rn | head

Parsing pitfalls

  • Two times. The syslog header has the logging time with no year; request_date has the request’s start time.
  • Optional braces. Captured headers appear as {…} only when captures are configured, shifting later fields.
  • Custom log-format. Many sites change the format; read the log-format line before trusting positions.
  • TCP lines in the same file. TCP-mode frontends log a shorter line without status or request.
  • Truncated requests. Long request lines are cut at the syslog length limit (1024 bytes by default).
  • Prefixed counters. With option logasap, timers and bytes carry a + because the line was written before the end.

Detection ideas

  • Denied by your own rules: <NOSRV> with 403 and PR-- — who triggers your deny rules most?
  • Path probes: request lines for /.env, /.git/, /wp-login.php, admin paths and ../.
  • Login guessing: many 401s from one client on a login path in a short time.
  • Slow clients: high TR or many cR-- from a few addresses holding connections open.
  • Bulk transfer: large bytes_read on export or download paths from unusual clients.

The free browser analyzer reads HAProxy HTTP logs and runs these checks locally.

Sending HAProxy to an LLM

One megabyte of this format is about 649,582 tokens on current Claude models and 511,421 on GPT models, measured with the models' own tokenizers — so a gigabyte sent raw to Claude Sonnet 5.5 costs about $1,299 in input tokens alone (prices of 2026-10-24). Estimate your own volume →

Detections and guides for HAProxy

Frequently Asked Questions

What does PR-- mean in an HAProxy log?
P on the first character means the proxy itself ended the session, for example because a deny rule matched, a connection limit was hit or a security check fired. R on the second means it was still waiting for or reading the request, so nothing was sent to any server. A 403 with <NOSRV> and PR-- is a request your http-request deny rules blocked.
What are the TR/Tw/Tc/Tr/Ta timers?
Milliseconds for the five phases of a request: TR receiving the full request from the client, Tw waiting in queues, Tc connecting to the server, Tr waiting for the server's response headers, and Ta the whole time the request was active. A value of -1 means the phase was never reached, which is what a request denied before reaching a server shows.
How do I get the client IP when HAProxy is behind a CDN?
client_ip is the address that connected to HAProxy. Either enable accept-proxy so the PROXY protocol header supplies the real address, or capture the forwarding header with "http-request capture req.hdr(X-Forwarded-For) len 64", which adds it to the captured request headers in braces. Only trust the header when it is set by your own edge.
Why don't my HAProxy logs show the request line?
Without "option httplog" in the frontend, HAProxy writes the shorter TCP log format, which has no status, request line or HTTP termination flags. Add option httplog (or a custom log-format) to HTTP frontends. Also note that "option dontlognull" drops connections that sent nothing, which hides some scanning.

Analyze a HAProxy file in your browser

The free analyzer detects this format, parses every field above and flags attack patterns — the file never leaves your machine. For threat-intel enrichment and an AI-written incident report, run it through LogTriage.

Investigating something right now? LogTriage checks every address in the file against threat intelligence and writes the incident report: 10 analyses a month free. The incident pack adds the in-depth AI analysis and files up to 100 MB: 25 analyses for $19, one payment, no subscription. Pricing

How this page was made. The official definitions, field names and examples on it are copied by script from the sources it links and re-checked against them on every build. The investigation advice was drafted with AI from those sources and passed a separate review before publishing. What is checked, and how · found a mistake? [email protected]