如何修改Azure应用网关查询以获取请求源IP/URL地址?
修改Kusto查询获取502请求的源IP与URL地址
可以直接调整原有查询,通过Azure应用网关访问日志的内置字段获取源IP和请求URL:
AzureDiagnostics | where Category == "ApplicationGatewayAccessLog" | where host_s == "xxxxx.com" | where httpStatus_d == 502 // httpStatus_d是数值类型,无需加引号 | project TimeGenerated, clientIP_s, requestUri_s, httpStatus_d, host_s | sort by TimeGenerated desc
核心字段说明:
clientIP_s:发起请求的源IP地址requestUri_s:请求的完整URL路径
如果需要更多请求细节(比如请求方法、用户代理),可以在project语句中追加对应字段,例如requestMethod_s、userAgent_s。
内容的提问来源于stack exchange,提问作者Michał Picheta
相关产品推荐
相关产品推荐

