Network ✓ fields verified against sample logs

Traefik Access Log Fields (JSON): Reference With Examples

Published

One JSON object per request in Traefik's access log: the client (ClientHost, ClientPort), the request (method, host, path, protocol), the router and service that handled it, the status from the backend and the status sent to the client, sizes, timings in nanoseconds, TLS details and any headers you choose to keep.

Official documentation: Traefik: Logs and access logs (configuration reference and field list)

Sample record

{
"ClientAddr": "203.0.113.10:52001",
"ClientHost": "203.0.113.10",
"ClientPort": "52001",
"ClientUsername": "-",
"DownstreamContentSize": 8192,
"DownstreamStatus": 200,
"Duration": 5432100,
"OriginContentSize": 8192,
"OriginDuration": 5120000,
"OriginStatus": 200,
"Overhead": 312100,
"RequestAddr": "api.example.com",
"RequestContentSize": 0,
"RequestCount": 1001,
"RequestHost": "api.example.com",
"RequestMethod": "GET",
"RequestPath": "/api/v1/dashboard",
"RequestPort": "-",
"RequestProtocol": "HTTP/2.0",
"RequestScheme": "https",
"RetryAttempts": 0,
"RouterName": "api@docker",
"ServiceAddr": "10.0.3.11:8080",
"ServiceName": "api-service@docker",
"ServiceURL": "http://10.0.3.11:8080",
"StartLocal": "2024-01-15T09:00:01.000000000Z",
"StartUTC": "2024-01-15T09:00:01.000000000Z",
"TLSCipher": "TLS_AES_128_GCM_SHA256",
"TLSVersion": "1.3",
"entryPointName": "websecure",
"level": "info",
"msg": "",
"request_User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
"time": "2024-01-15T09:00:01Z"
}

Numbered lines are the fields in the table.

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
1ClientHoste.g. 185.220.101.42 IP address Traefik: "The remote IP address from which the client request was received." ClientAddr keeps the original form, usually address:port. Behind a CDN or load balancer this is that device unless forwardedHeaders.trustedIPs or proxyProtocol is configured on the entry point.
2ClientUsernamee.g. - string Traefik: "The username provided in the URL, if present"; with basic auth, the authenticated user. Ties requests to an account where Traefik handles authentication.
3RequestMethode.g. DELETE string Traefik: "The HTTP method." DELETE and PUT from unfamiliar clients on resource paths are changes, not reads.
4RequestHoste.g. api.example.com string Traefik: "The HTTP Host server name (not including port)." Requests for your bare IP or unknown hosts are scanners; real users use your names.
5RequestPathe.g. /api/v1/data/export string Traefik: "The HTTP request URI, not including the scheme, host or port" — with the query string. Admin paths, exports and probe paths (/.env, /.git) show here.
6RouterNamee.g. admin@docker string Traefik: "The name of the Traefik router", with the provider after @ (docker, file, kubernetescrd…). Tells you which route rule matched — an admin router answering public clients is a routing mistake.
7ServiceNamee.g. api-service@docker string Traefik: "The name of the Traefik backend." Absent when a middleware answered before the request reached a service. A record without ServiceName was stopped or answered by Traefik itself.
8OriginStatuse.g. 0 number Traefik: "The HTTP status code resulting from proxying the request to a backend"; 0 when no backend was called. 0 with a 403 downstream means a middleware (IP allow list, forward auth, basic auth) refused the request.
9DownstreamStatuse.g. 401 number Traefik: "The HTTP status code sent to the client, after the middleware chain." The status the client saw; use it for 401/403 bursts per client.
10DownstreamContentSizee.g. 524288 number Traefik: "The number of bytes in the response entity returned to the client." Sum per client to find bulk downloads.
11Duratione.g. 8901234 nanoseconds Traefik: "The total time taken (in nanoseconds) by processing the response." OriginDuration is the backend's share, Overhead Traefik's. Divide by 1,000,000 for milliseconds; slow exports and searches stand out.
12StartUTCe.g. 2024-01-15T14:30:04.000000000Z date-time Traefik: "The time at which request processing started", in UTC with nanoseconds. The request's own time; `time` is when the line was written.
13RetryAttemptse.g. 0 number Traefik: "The amount of attempts the request was retried." Retries during an incident point to a failing backend rather than an attack.
14TLSVersione.g. 1.3 string Traefik: "The TLS version used by the connection (if connection is TLS)." TLSCipher has the cipher. Old TLS versions from one client are often old scanners.
15request_User-Agente.g. sqlmap/1.7.8#stable (https://sqlmap.org) string A request header, written as request_ followed by the header name. Headers are dropped by default and appear only when the access log's headers settings keep them. Keep User-Agent (and X-Forwarded-For, Referer) explicitly — without it, scripted tools cannot be told from browsers.

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 accessLog enabled and format: json, Traefik writes one JSON object per request with the fields listed in its logs and access logs reference: the client, the request, the router and service that handled it, status and size from the backend and to the client, durations in nanoseconds, TLS version and cipher, a request counter, Kubernetes resource names when the provider is Kubernetes, and any headers you keep. The default format is common (Traefik’s extended CLF), which holds less: client, user, time, request line, status, size, referrer, user agent, request count, router, server URL and duration.

Two field pairs matter in an investigation. OriginStatus and DownstreamStatus separate what the application answered from what the client got, so you can see which refusals came from Traefik’s own middlewares. ClientHost is only the real client if the entry point trusts your forwarding device; otherwise every request shows the load balancer.

The malicious sample has one address running sqlmap against the admin router (refused by a middleware: no service, OriginStatus 0, 403) and posting to the login API (401), and a second address pulling a half-megabyte export with axios and deleting a user through the API.

Where to get it

  • Static configuration. accessLog: {filePath: /var/log/traefik/access.log, format: json, fields: {headers: {names: {User-Agent: keep}}}}; without filePath the log goes to standard output.
  • Containers. With standard output, read it through docker logs or the Kubernetes log pipeline; each line is then wrapped by the runtime.
  • Filters. accessLog.filters can keep only error statuses, retried or slow requests — useful for volume, but you lose the successful requests that show what an attacker reached.
# Requests refused by Traefik itself (no backend called), per client
jq -r 'select(.OriginStatus == 0 and .DownstreamStatus >= 400) | .ClientHost' access.log | sort | uniq -c | sort -rn

Parsing pitfalls

  • Headers dropped by default. No request_User-Agent unless configured.
  • Nanoseconds. Duration, OriginDuration and Overhead are in nanoseconds; the CLF format uses milliseconds.
  • Ports as strings. ClientPort and RequestPort are strings, - when absent.
  • Wrapped lines. In Docker and Kubernetes each JSON line is inside the runtime’s own JSON or text envelope.
  • Two formats in one fleet. Instances left on the default write CLF lines, not JSON.
  • Filtered logs. With filters set, absent requests do not mean nothing happened.

Detection ideas

  • Tools and scripts: request_User-Agent values such as sqlmap, curl, python-requests on application routers.
  • Middleware refusals: OriginStatus 0 with 401/403 — who keeps hitting routes they are not allowed on?
  • Login guessing: DownstreamStatus 401 bursts per ClientHost on login paths.
  • Bulk reads and destructive calls: large DownstreamContentSize on exports; DELETE from new clients.
  • Unknown hosts: RequestHost values that are not your domains.

The free browser analyzer reads Traefik JSON access logs and runs these checks locally.

Sending Traefik to an LLM

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

Frequently Asked Questions

Why is the User-Agent missing from my Traefik access log?
Traefik drops request headers from the access log by default. Set accessLog.fields.headers.defaultMode to keep, or keep chosen headers under accessLog.fields.headers.names (for example User-Agent: keep, Authorization: drop). Kept headers appear as request_User-Agent and so on. Leave Authorization and Cookie dropped or redacted.
What is the difference between OriginStatus and DownstreamStatus?
OriginStatus is what the backend service answered; DownstreamStatus is what the client received after the middleware chain. They differ when a middleware answers on its own (an IP allow list or forward-auth refusal gives OriginStatus 0 and DownstreamStatus 403) or rewrites the response, such as an error-pages middleware.
What unit is Duration in Traefik logs?
Nanoseconds. Duration is the total time, OriginDuration the time the backend took and Overhead the time Traefik added, all in nanoseconds; divide by 1,000,000 for milliseconds. The common (CLF) format writes the duration in milliseconds at the end of the line instead.
How do I get the real client IP behind a load balancer?
Configure the entry point to trust the forwarding device: forwardedHeaders.trustedIPs for X-Forwarded-For, or proxyProtocol.trustedIPs for the PROXY protocol. Traefik then uses the forwarded address as ClientHost. Without it, ClientHost is the load balancer and every request appears to come from one address.

Analyze a Traefik 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]