如何查询 Azure 应用服务 AppServiceHTTPLogs 的源 IP、目标 IP 和 URL 名称?

问题描述 投票:0回答:1

我正在使用 Azure 应用服务,我需要监视和分析 HTTP 流量。 我想从 AppServiceHTTPLogs 表中检索源 IP、目标 IP 和 URL 名称。但是,我不太确定如何构建此特定信息的查询。

有人可以提供一个示例查询,用于查询 Azure Monitor 中的 AppServiceHTTPLogs 表以从 HTTP 日志中提取源 IP、目标 IP 和 URL 名称吗?

示例:我正在尝试计算在定义的时间段内从特定源(我们称之为 A)到特定目标(我们称之为 B)的 API 请求所花费的总时间。但是,我在为该任务构建适当的查询时遇到困难

azure azure-web-app-service azure-application-insights azure-monitoring azure-appservice
1个回答
0
投票

这是一个提取数据的查询,并计算一段时间内从特定源到特定目标的请求所花费的总时间(将 A 和 B 替换为实际的源和目标 IP 地址):

完整日志 enter image description here

查询以从 AppServiceHTTPLogs 表中检索 源 IP、目标 IP(SPort)和 URL 名称

AppServiceHTTPLogs | where CIp == "127.0.0.1" and SPort == "443" | where TimeGenerated > ago(1d) | project CIp, SPort, CsUriQuery, TimeTaken | summarize TotalTimeTaken = sum(TimeTaken) by CIp, SPort, CsUriQuery

结果 enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.