# Microsoft Sentinel / Azure Monitor: native IIS access logs

Open [ai_file_requests.kql](ai_file_requests.kql) in Logs for the workspace receiving your IIS logs. It searches the documented `W3CIISLog` table over the last 24 hours; change the explicit window to suit the investigation.

Prerequisites: IIS W3C logging on the relevant Windows server, Azure Monitor Agent collection through an IIS data collection rule, a Log Analytics destination, and query permission. Workspace ingestion and retention charges apply. Microsoft Sentinel is needed for a Sentinel analytics rule; a manual Azure Monitor Logs hunt does not require creating one. This package does not configure collection or deploy an analytics rule. Follow [Microsoft's IIS collection guide](https://learn.microsoft.com/en-us/azure/azure-monitor/vm/data-collection-iis).

Before running the hunt, inspect current events:

```kql
W3CIISLog
| where TimeGenerated >= ago(24h)
| project TimeGenerated, Computer, csUriStem, csMethod, cIP, scStatus
| take 20
```

`csUriStem` must hold the request path. `csUriQuery` is a separate query component and is deliberately excluded from matching. `cIP` is the client visible to IIS, which may be a proxy. `Computer` identifies the collecting host; `csHost` is request context and can be client-supplied. The hunt retains each event without collapsing clients or hosts.

The query strips any literal query suffix, decodes once with `url_decode`, lowercases the result, and compares the same selected endings as Sigma. Local `OriginalPath`, `MatchPath`, `CredentialPath`, and `Finding` are query results, not required ingestion fields. Original query values are not projected by the supplied hunt.

Use an authorized test request for a nonexistent selected filename to verify end-to-end collection. Then try an ordinary page and a query-only filename mention. Missing paths do not match. The documented fields and local fixture logic were checked; KQL compilation and tenant execution were not performed. Review the [shared scope limits](../README.md#scope-and-normalization) before using results in a detection workflow.

Primary references: [W3CIISLog fields](https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/w3ciislog) and [`url_decode`](https://learn.microsoft.com/en-us/kusto/query/url-decode-function?view=microsoft-fabric).
