Web ✓ fields verified against sample logs

IIS Log Fields: W3C Extended Format Reference With Examples

Published

One line per HTTP request IIS served: when (UTC), which client address asked for which path with which method and user agent, the account if the request was authenticated, and how IIS answered — HTTP status, IIS substatus, the Windows status code and the time taken.

Official documentation: Microsoft: W3C Logging (field names and definitions) · Microsoft: Configure Logging in IIS · Microsoft: W3CIISLog table in Azure Monitor

Sample record

#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status time-taken sc-bytes
2024-01-15 09:00:01 10.0.0.10 GET /index.html - 443 alice 203.0.113.10 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36 200 0 0 46 12345
2024-01-15 09:01:00 10.0.0.10 POST /api/v1/data - 443 alice 203.0.113.10 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36 200 0 0 112 8192

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
datee.g. 2024-01-15 date (YYYY-MM-DD) Microsoft: "The date on which the activity occurred." In W3C format the date and time are UTC, so they line up with other UTC sources without a time-zone conversion.
timee.g. 09:00:01 time (HH:MM:SS) Microsoft: "The time, in coordinated universal time (UTC), at which the activity occurred." It is the time the request was logged, at the end of processing, not when it arrived; subtract time-taken to get the start.
s-ipe.g. 10.0.0.10 IP address Microsoft: "The IP address of the server on which the log file entry was generated." Tells you which node of a farm answered; useful when several servers' logs are merged.
cs-methode.g. GET string Microsoft: "The requested verb, for example, a GET method." PUT, DELETE, PROPFIND or OPTIONS against a site that only serves pages is worth a look; POST to a login path in volume is password guessing.
cs-uri-steme.g. /admin/web.config string Microsoft: "The target of the verb, for example, Default.htm." The path, without the query string. The field most probes show up in — web.config, .git/config, admin pages and traversal sequences.
cs-uri-querye.g. ?action=export string or "-" Microsoft: "The query, if any, that the client was trying to perform." A hyphen when there is none. Injection payloads usually live here, not in the stem; search both when looking for SQL injection or command injection strings.
s-porte.g. 443 number Microsoft: "The server port number that is configured for the service." Requests to port 80 on a site that should be HTTPS-only show clients (or scanners) skipping the redirect.
cs-usernamee.g. alice string or "-" Microsoft: "The name of the authenticated user that accessed the server. Anonymous users are indicated by a hyphen." Only IIS authentication (Windows, Basic) fills it; an application that does its own login leaves it "-" even for signed-in users.
c-ipe.g. 203.0.113.10 IP address Microsoft: "The IP address of the client that made the request." Behind a load balancer or CDN this is the proxy, not the visitor; the real client is then only in a forwarded-for header, if one is logged.
cs(User-Agent)e.g. sqlmap/1.7+(https://sqlmap.org) string Microsoft: "The browser type that the client used." Spaces inside the value are written as +. Tools announce themselves here (sqlmap, python-requests); a browser string proves nothing, since any client can send one.
sc-statuse.g. 401 number Microsoft: "The HTTP status code." Runs of 401 from one c-ip are credential guessing; 404 bursts are scanning; a 200 after many 401s from the same address is a guess that worked.
sc-substatuse.g. 0 number Microsoft: "The substatus error code." IIS's own refinement of sc-status, written after a dot when discussed (404.8, 401.1). Separates causes the HTTP status lumps together — for example which request-filtering rule produced a 404, or why a 401 was returned.
sc-win32-statuse.g. 0 number Microsoft: "The Windows status code." A Win32 error code in decimal; 0 is ERROR_SUCCESS. 64 (ERROR_NETNAME_DELETED) and 1236 (ERROR_CONNECTION_ABORTED) mean the connection ended before the response finished — clients giving up, or a scanner that does not wait.
time-takene.g. 4875 number (milliseconds) Microsoft: "The length of time that the action took, in milliseconds." A slow request that also sent many bytes is a candidate data export; slow responses to injection payloads can be time-based SQL injection working.
sc-bytese.g. 524288 number Microsoft: "The number of bytes sent by the server." Not in IIS's default field set; enable it under Select Fields. The quickest way to spot a response that carried far more data than the page usually does.

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

IIS writes one line per request to a site’s W3C log. The #Fields: header names the columns in order, and Microsoft documents each one in its W3C logging reference: s- fields describe the server, c- the client, cs- what the client sent and sc- what the server sent back. A hyphen stands for a field that is selected but empty.

The line tells you who asked (c-ip, cs(User-Agent), cs-username), what they asked for (cs-method, cs-uri-stem, cs-uri-query, s-port) and how IIS answered: the HTTP status, IIS’s own sc-substatus, the Windows status code in sc-win32-status, how long it took and, when enabled, how many bytes went back. The malicious sample on this page shows the usual early stages of an attack in that shape — a sqlmap user agent asking for /admin/web.config, a traversal attempt, a failed login (401) and then a 200 for an export that took almost five seconds and sent half a megabyte.

Where to get it

  • On the server. Microsoft’s default directory is %SystemDrive%\inetpub\logs\LogFiles, with a folder per site (W3SVC1 for the first site). The site’s ID is in IIS Manager, so you can match folders to sites.
  • The field set. In IIS Manager, open the site’s Logging page and choose Select Fields. The default set does not include sc-bytes or cs-bytes; turn them on before you need them, not during an incident.
  • Azure Monitor and Microsoft Sentinel. The Azure Monitor agent can collect IIS logs into the W3CIISLog table, where the fields become columns such as cIP, csUriStem and scWin32Status.
// Clients that failed authentication repeatedly, and whether any of them then succeeded
W3CIISLog
| where TimeGenerated > ago(1d)
| summarize Failures = countif(scStatus == 401), Successes = countif(scStatus between (200 .. 299)),
            Paths = make_set(csUriStem, 10) by cIP, csUserAgent
| where Failures >= 20
| order by Failures desc

Parsing pitfalls

  • The header decides the columns. Field order and selection differ between servers and change when someone edits the logging settings; a new #Fields: line can appear in the middle of a file after a restart. Parse each block with the header above it, never with fixed positions.
  • Spaces become +. Inside a value, spaces are written as +, as the user agents above show, so a literal + in a user agent or query cannot be told apart from a space.
  • Hyphens mean empty. - in cs-uri-query or cs-username is “nothing”, not a value; do not count it as a user.
  • The status is three numbers. sc-status, sc-substatus and sc-win32-status belong together. A 404 with substatus 0 and a 404 caused by request filtering look the same if you keep only the first.
  • sc-win32-status is decimal. Windows documents error codes in hexadecimal too: 64 is 0x40. Paste either form into the error-code lookup to see Microsoft’s name for it.
  • c-ip can be a proxy. Behind a load balancer or Azure Front Door every request has the proxy’s address; enable logging of the forwarded-for header (a custom field) or read the proxy’s logs.

Detection ideas

  • Scanning: many 404s from one c-ip, across paths such as /.git/config, /.env, web.config and admin pages. The web probe reference explains the common ones.
  • Attack tools in the user agent: sqlmap, nikto, python-requests against pages people normally browse.
  • Password guessing: runs of 401 on a login path from one address or across many accounts, especially a 200 from the same address afterwards.
  • Injection: SQL or command fragments in cs-uri-query, and requests with unusually long time-taken that carry them.
  • Data leaving: a large sc-bytes with a long time-taken on an export or admin path, from an address that was already failing logins minutes earlier — the fourth line of the malicious sample.

The free browser analyzer reads IIS W3C logs and runs these checks without uploading the file, and the log line explainer explains a single line field by field.

Sending IIS W3C Extended to an LLM

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

Frequently Asked Questions

Are the times in an IIS log local time or UTC?
In the W3C format, which is IIS's default, the date and time fields are UTC — Microsoft says so for the time field, and the IIS logging settings note that W3C timestamps use UTC whatever the rollover setting. The older IIS and NCSA formats record local time instead, so check the format before correlating with other sources.
What does sc-win32-status 64 mean?
It is the Win32 error code 64, ERROR_NETNAME_DELETED, "The specified network name is no longer available." In a web log it means the connection to the client was gone before IIS finished sending the response. Users closing tabs produce it; so do scanners that drop connections. Look it up with any other value in the error-code lookup.
Why is cs-username "-" for users who are logged in?
The field holds only the user IIS itself authenticated, with Windows or Basic authentication. Applications that run their own sign-in, with forms or tokens, are anonymous as far as IIS is concerned, so every request shows a hyphen. The user then has to be found in the application's own logs.
Where are requests that never reached IIS?
Requests that HTTP.sys rejects before handing them to a site — malformed requests, some invalid URLs, connection timeouts — are not written to the site's W3C log. HTTP.sys records them in its own HTTPERR log. When a scan seems to have fewer requests than expected, check there too.

Analyze a IIS W3C Extended 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]