AzureDiagnostics
存储使用 Azure 诊断模式的 Azure 服务的资源日志。 资源日志描述 Azure 资源的内部操作。
每个 Azure 服务的资源日志具有一组唯一的列。 AzureDiagnostics 表包含 Azure 服务最常用的列。 如果资源日志包含一列,但该列在 AzureDiagnostics 表中尚不存在,则会在第一次收集数据时添加该列。 如果达到 500 列的最大数量,则任何其他列的数据都会添加到动态列中。
使用特定于资源的模式的 Azure 服务将数据存储在特定于该服务的表中,而不使用 AzureDiagnostics 表。 有关使用每个方法的服务,请参阅 下面的资源类型 。 有关差异的详细信息,请参阅 Azure 资源日志 。
注意
AzureDiagnostics 表是 Azure Monitor 管道首次开始以Azure 诊断模式发送日志时专用创建的自定义日志表。 与其他表不同,无法通过 ARM 模板或表 API 创建 AzureDiagnostics 表。 因此,在创建表之前,无法修改表的默认保留值。
AdditionalFields 列
与其他表不同, AzureDiagnostics 更容易超过 Log Analytics 工作区中任何表施加的 500 列限制,因为能够将数据发送到此表的 Azure 资源的广泛分类。 为了确保由于活动列数超过此 500 列限制而丢失任何数据,AzureDiagnostics 列创建的方式与其他表不同。
每个工作区中的 AzureDiagnostics 表至少包含相同的 200 列。 对于在 2021 年 1 月 19 日之前创建的工作区,该表还包含在此日期之前已有的任何列。 将数据发送到尚未到位的列时:
- 如果当前工作区中的 AzureDiagnostics 中的列总数不超过 500,则会像使用任何其他表一样创建新列。
- 如果列总数在 500 或更高,则会将多余的数据添加到名为 AdditionalFields 的动态属性包列作为属性。
示例
为了说明此行为,假设从(部署日期)开始,我们的 Workpsace 中的 AzureDiagnostics 表如下所示:
列 1 | 列 2 | 列 3 | ... | 列 498 |
---|---|---|---|---|
abc | def | 123 | ... | 456 |
... | ... | ... | ... | ... |
将数据发送到 AzureDiagnostics 的资源,然后将新维度添加到其调用 NewInfo1 的数据中。 由于该表仍然少于 500 列,因此首次发生包含此新维度数据的事件会将新列添加到表中:
列 1 | 列 2 | 列 3 | ... | 列 498 | NewInfo1_s |
---|---|---|---|---|---|
abc | def | 123 | ... | 456 | xyz |
... | ... | ... | ... | ... | ... |
可以在简单的查询中返回此新数据:
AzureDiagnostics | where NewInfo1_s == "xyz"
稍后,另一个资源将数据发送到 AzureDiagnostics ,该数据添加了名为 NewInfo2 和 NewInfo3 的新维度。 由于此工作区中的表已达 500 列,因此新数据将进入 AdditionalFields 列:
列 1 | 列 2 | 列 3 | ... | 列 498 | NewInfo1_s | AdditionalFields |
---|---|---|---|---|---|---|
abc | def | 123 | ... | 456 | xyz | {“NewInfo2”:“789”,“NewInfo3”:“qwerty”} |
... | ... | ... | ... | ... | ... | ... |
你仍然可以查询此数据,但必须使用 KQL 中的任何动态属性运算符从属性包中提取它:
AzureDiagnostics
| where AdditionalFields.NewInfo2 == "789" and AdditionalFields.NewInfo3 == "qwerty"
有关使用列的 AdditionalFields
提示
尽管常规查询最佳做法(如始终按时间筛选查询中的第一个子句)应遵循,但使用 AdditionalFields 时应考虑一些其他建议:
- 在对数据执行进一步操作之前,必须键入数据。 例如,如果存在名为 Perf1Sec_i 的列,以及名为 Perf2Sec 的 AdditionalFields 中的属性,并且你想要通过添加这两个值来计算总性能,请使用如下内容:
AzureDiagnostics | extend TotalPerfSec = Perf1Sec_i + toint(AdditionalFields.Perf2Sec) | ....
- 在编写任何复杂逻辑以显著提高性能之前,使用 where 子句将数据量减少到尽可能小。 TimeGenerated 是一列,应始终减少到尽可能小的窗口。 对于 AzureDiagnostics,还应始终在查询顶部包含使用 ResourceType 列查询的资源类型的其他筛选器。
- 查询大量数据时,有时对 AdditionalFields 执行整个筛选器而不是分析它的效率更高。 例如,对于大量数据
AzureDiagnostics | where AdditionalFields has "Perf2Sec"
,其效率通常比AzureDiagnostics | where isnotnull(toint(AdditionalFields.Perf2Sec))
。
Azure 诊断模式
以下服务将 Azure 诊断模式用于其资源日志,并将数据发送到Azure 诊断表。
- Analysis Services
- 应用程序网关
- 自动化帐户
- Azure Database for MariaDB 服务器
- Azure Database for MySQL 服务器
- Azure Database for PostgreSQL 服务器
- Azure Database for PostgreSQL 服务器 v2
- 批处理帐户
- CDN 配置文件
- 认知服务
- 数据湖分析
- DataLake Storage Gen1
- 设备预配服务
- 数字孪生
- 事件网格主题
- 事件中心
- ExpressRoute 线路
- Front Door
- 集成帐户
- 密钥保管库
- Kubernetes 服务
- 负载均衡器
- 逻辑应用程序
- 媒体服务
- 网络接口
- 网络安全组
- P2S VPN 网关
- Power BI Embedded
- 公共 IP 地址
- 恢复服务保管库(Site Recovery)
- 搜索服务
- 服务总线
- SQL 数据库
- SQL 托管实例
- SQL Server
- 流分析作业
- 流量管理器配置文件
- 虚拟网络
- 虚拟网络网关
- VPN 网关
Azure 诊断模式或特定于资源的模式
以下服务根据资源日志的配置使用 Azure 诊断模式或特定于资源的模式。 使用特定于资源的模式时,它们不会将数据发送到 AzureDiagnostics 表。 有关此配置的详细信息,请参阅 Azure 资源日志 。
- API 管理服务
- Azure Cosmos DB
- 数据工厂(V2)
- IoT 中心
- 恢复服务保管库(备份)
- 防火墙
类别
- Azure 资源
- 安全性
- 网络
解决方案
- LogManagement
资源类型
- 应用程序网关
- CDN 配置文件
- Azure Cosmos DB
- 事件网格主题
- 事件中心
- 防火墙
- 密钥保管库
- Kubernetes 服务
- 恢复服务保管库
- 服务总线
- Azure Database for MySQL 灵活服务器
- Azure Database for PostgreSQL 灵活服务器
- 媒体服务
- Analysis Services
- Batch 帐户
- 认知服务
- 事件网格合作伙伴命名空间
- 事件网格合作伙伴主题
- 事件网格系统主题
- 已启用 Azure Arc 的 Kubernetes
- Azure Arc 预配群集
- IoT 中心
- 逻辑应用程序
- API 管理服务
- 自动化帐户
- 数据工厂
- Data Lake Storage Gen1
- 数据湖分析
- Power BI Embedded
- SQL 托管实例
- SQL Server
- SQL 数据库
- Azure Database for MySQL 服务器
- Azure Database for PostgreSQL 服务器
- Azure Database for PostgreSQL 服务器 V2
- Azure Database for MariaDB 服务器
- 设备预配服务
- ExpressRoute 线路
- Front Door
- 网络接口
- 网络安全组
- 公共 IP 地址
- 流量管理器配置文件
- 虚拟网络网关
- 虚拟专用网络网关
- 虚拟网络
- 搜索服务
- 流分析作业
列
列 | 类型 | 描述 |
---|---|---|
action_id_s | 字符串 | |
action_name_s | 字符串 | |
action_s | 字符串 | |
ActivityId_g | Guid | |
AdditionalFields | ||
AdHocOrScheduledJob_s | 字符串 | |
application_name_s | 字符串 | |
audit_schema_version_d | 双精度 | |
avg_cpu_percent_s | 字符串 | |
avg_mean_time_s | 字符串 | |
backendHostname_s | 字符串 | |
Caller_s | 字符串 | |
callerId_s | 字符串 | |
CallerIPAddress | 字符串 | |
calls_s | 字符串 | |
Category | 字符串 | |
client_ip_s | 字符串 | |
clientInfo_s | 字符串 | |
clientIP_s | 字符串 | |
clientIp_s | 字符串 | |
clientIpAddress_s | 字符串 | |
clientPort_d | 双精度 | |
code_s | 字符串 | |
collectionName_s | 字符串 | |
conditions_destinationIP_s | 字符串 | |
conditions_destinationPortRange_s | 字符串 | |
conditions_None_s | 字符串 | |
conditions_protocols_s | 字符串 | |
conditions_sourceIP_s | 字符串 | |
conditions_sourcePortRange_s | 字符串 | |
CorrelationId | 字符串 | |
count_executions_d | 双精度 | |
cpu_time_d | 双精度 | |
database_name_s | 字符串 | |
database_principal_name_s | 字符串 | |
DatabaseName_s | 字符串 | |
db_id_s | 字符串 | |
direction_s | 字符串 | |
dop_d | 双精度 | |
duration_d | 双精度 | |
duration_milliseconds_d | 双精度 | |
DurationMs | Bigint | |
ElasticPoolName_s | 字符串 | |
endTime_t | DateTime | |
Environment_s | 字符串 | |
error_code_s | 字符串 | |
error_message_s | 字符串 | |
errorLevel_s | 字符串 | |
event_class_s | 字符串 | |
event_s | 字符串 | |
event_subclass_s | 字符串 | |
event_time_t | DateTime | |
EventName_s | 字符串 | |
execution_type_d | 双精度 | |
executionInfo_endTime_t | DateTime | |
executionInfo_exitCode_d | 双精度 | |
executionInfo_startTime_t | DateTime | |
host_s | 字符串 | |
httpMethod_s | 字符串 | |
httpStatus_d | 双精度 | |
httpStatusCode_d | 双精度 | |
httpStatusCode_s | 字符串 | |
httpVersion_s | 字符串 | |
id_s | 字符串 | |
identity_claim_appid_g | Guid | |
identity_claim_ipaddr_s | 字符串 | |
instanceId_s | 字符串 | |
interval_end_time_d | 双精度 | |
interval_start_time_d | 双精度 | |
ip_s | 字符串 | |
is_column_permission_s | 字符串 | |
isAccessPolicyMatch_b | Bool | |
JobDurationInSecs_s | 字符串 | |
JobFailureCode_s | 字符串 | |
JobId_g | Guid | |
jobId_s | 字符串 | |
JobOperation_s | 字符串 | |
JobOperationSubType_s | 字符串 | |
JobStartDateTime_s | 字符串 | |
JobStatus_s | 字符串 | |
JobUniqueId_g | Guid | |
级别 | 字符串 | |
log_bytes_used_d | 双精度 | |
logical_io_reads_d | 双精度 | |
logical_io_writes_d | 双精度 | |
LogicalServerName_s | 字符串 | |
macAddress_s | 字符串 | |
matchedConnections_d | 双精度 | |
max_cpu_time_d | 双精度 | |
max_dop_d | 双精度 | |
max_duration_d | 双精度 | |
max_log_bytes_used_d | 双精度 | |
max_logical_io_reads_d | 双精度 | |
max_logical_io_writes_d | 双精度 | |
max_num_physical_io_reads_d | 双精度 | |
max_physical_io_reads_d | 双精度 | |
max_query_max_used_memory_d | 双精度 | |
max_rowcount_d | 双精度 | |
max_time_s | 字符串 | |
mean_time_s | 字符串 | |
Message | 字符串 | |
min_time_s | 字符串 | |
msg_s | 字符串 | |
num_physical_io_reads_d | 双精度 | |
object_id_d | 双精度 | |
object_name_s | 字符串 | |
OperationName | 字符串 | |
OperationVersion | 字符串 | |
partitionKey_s | 字符串 | |
physical_io_reads_d | 双精度 | |
plan_id_d | 双精度 | |
policy_s | 字符串 | |
policyMode_s | 字符串 | |
primaryIPv4Address_s | 字符串 | |
priority_d | 双精度 | |
properties_enabledForDeployment_b | Bool | |
properties_enabledForDiskEncryption_b | Bool | |
properties_enabledForTemplateDeployment_b | Bool | |
properties_s | 字符串 | |
properties_sku_Family_s | 字符串 | |
properties_sku_Name_s | 字符串 | |
properties_tenantId_g | Guid | |
query_hash_s | 字符串 | |
query_id_d | 双精度 | |
query_max_used_memory_d | 双精度 | |
query_plan_hash_s | 字符串 | |
query_time_d | 双精度 | |
querytext_s | 字符串 | |
receivedBytes_d | 双精度 | |
Region_s | 字符串 | |
requestCharge_s | 字符串 | |
requestQuery_s | 字符串 | |
requestResourceId_s | 字符串 | |
requestResourceType_s | 字符串 | |
requestUri_s | 字符串 | |
reserved_storage_mb_s | 字符串 | |
资源 | 字符串 | |
resource_actionName_s | 字符串 | |
resource_location_s | 字符串 | |
resource_originRunId_s | 字符串 | |
resource_resourceGroupName_s | 字符串 | |
resource_runId_s | 字符串 | |
resource_subscriptionId_g | Guid | |
resource_triggerName_s | 字符串 | |
resource_workflowId_g | Guid | |
resource_workflowName_s | 字符串 | |
ResourceGroup | 字符串 | |
_ResourceId | 字符串 | 与记录关联的资源的唯一标识符 |
ResourceProvider | 字符串 | |
ResourceProvider | 字符串 | |
ResourceType | 字符串 | |
ResourceType | 字符串 | |
response_rows_d | 双精度 | |
resultCode_s | 字符串 | |
ResultDescription | 字符串 | |
ResultDescription | 字符串 | |
resultDescription_ChildJobs_s | 字符串 | |
resultDescription_ErrorJobs_s | 字符串 | |
resultMessage_s | 字符串 | |
ResultSignature | 字符串 | |
ResultType | 字符串 | |
ResultType | 字符串 | |
rootCauseAnalysis_s | 字符串 | |
routingRuleName_s | 字符串 | |
rowcount_d | 双精度 | |
ruleName_s | 字符串 | |
RunbookName_s | 字符串 | |
RunOn_s | 字符串 | |
schema_name_s | 字符串 | |
sentBytes_d | 双精度 | |
sequence_group_id_g | Guid | |
sequence_number_d | 双精度 | |
server_principal_sid_s | 字符串 | |
session_id_d | 双精度 |