AzureDiagnostics
儲存使用了 Azure 診斷模式的 Azure 服務資源記錄。 資源記錄會描述 Azure 資源的內部作業。
每個 Azure 服務的資源記錄都有一組獨特的資料行。 AzureDiagnostics 資料表包含 Azure 服務最常使用的資料行。 如果資源記錄包含尚不存在於 AzureDiagnostics 資料表中的資料行,則會在第一次收集資料時新增該資料行。 如果達到數目上限 500 個資料行,則會將任何額外資料行的資料新增至動態資料行。
使用資源特定模式的 Azure 服務會將資料儲存在該服務特定的資料表中,且不使用 AzureDiagnostics 資料表。 如需使用每個方法的服務,請參閱下方 的資源類型 。 如需差異的詳細資訊,請參閱 Azure 資源記錄 。
AdditionalFields 資料行
不同于其他資料表, AzureDiagnostics 會因為能夠將資料傳送至此資料表的 Azure 資源,而更容易超過 Log Analytics 工作區中任何資料表所加加的 500 個數據行限制。 為了確保由於超過此 500 個數據行限制的作用中資料行數目而遺失任何資料,AzureDiagnostics 資料行建立會以其他資料表不同的方式處理。
每個工作區中的 AzureDiagnostics 資料表至少會包含相同的 200 個數據行。 對於在 2021 年 1 月 19 日之前建立的工作區,資料表也會包含在此日期之前已就緒的任何資料行。 當資料傳送至尚未就緒的資料行時:
- 如果目前工作區中 AzureDiagnostics 中的資料行總數不超過 500,則會建立新的資料行,就像使用任何其他資料表一樣。
- 如果資料行總數在或高於 500,則會將多餘的資料新增至稱為 AdditionalFields 的動態屬性包資料行作為屬性。
範例
為了說明此行為,假設從 (部署日期開始,) 我們的工作案例中的 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 時,您應該考慮一些其他建議:
- 您必須先輸入cast 資料,再對它執行進一步的作業。 例如,如果資料行存在名為 Perf1Sec_i,以及名為Perf2Sec的 AdditionalFields中的屬性,而且您想要藉由新增這兩個值來計算總 perf,請使用如下的專案:
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
- 應用程式閘道
- 自動化帳戶
- 適用於 MariaDB 的 Azure 資料庫伺服器
- 適用於 MySQL 的 Azure 資料庫伺服器
- 適用於 PostgreSQL 的 Azure 資料庫伺服器
- 適用於 PostgreSQL 的 Azure 資料庫伺服器 v2
- Batch 帳戶
- CDN 設定檔
- 認知服務
- Data Lake Analytics
- DataLake Storage Gen1
- 裝置佈建服務
- Digital Twins
- 事件方格主題
- 事件中樞
- ExpressRoute 線路
- 前門
- 整合帳戶
- Key Vault
- Kubernetes 服務
- 負載平衡器
- Logic Apps
- 媒體服務
- 網路介面
- 網路安全性群組
- P2S VPN 閘道
- Power BI Embedded
- 公用 IP 位址
- 復原服務保存庫 (Site Recovery)
- 搜尋服務
- 服務匯流排
- SQL DATABASE
- SQL 受控實例
- SQL Server
- 串流分析作業
- 流量管理員設定檔
- 虛擬網路
- 虛擬網路閘道
- VPN 閘道
Azure 診斷模式或資源特定模式
下列服務會根據其設定,針對其資源記錄使用 Azure 診斷模式或資源特定模式。 當他們使用資源特定模式時,不會將資料傳送至 AzureDiagnostics 資料表。 如需此設定的詳細資訊,請參閱 Azure 資源記錄 。
- API 管理服務
- Azure Cosmos DB
- Data Factory (V2)
- IoT 中樞
- 復原服務保存庫 (備份)
- 防火牆
類別
- Azure 資源
- 安全性
- 網路
方案
- LogManagement
資源類型
- 應用程式閘道
- CDN 設定檔
- Azure Cosmos DB
- 事件方格主題
- 事件中樞
- 防火牆
- 金鑰保存庫
- Kubernetes 服務
- 復原服務保存庫
- 服務匯流排
- 適用於 MySQL 的 Azure 資料庫彈性伺服器
- 適用於 PostgreSQL 的 Azure 資料庫彈性伺服器
- 媒體服務
- Analysis Services
- Batch 帳戶
- 認知服務
- 事件方格合作夥伴命名空間
- 事件方格合作夥伴主題
- 事件方格系統主題
- 已啟用 Azure Arc 的 Kubernetes
- Azure Arc 布建叢集
- IoT 中樞
- Logic Apps
- API 管理服務
- 自動化帳戶
- 資料處理站
- Data Lake Storage Gen1
- Data Lake Analytics
- Power BI Embedded
- SQL 受控執行個體
- SQL Server
- SQL Database
- 適用於 MySQL 的 Azure 資料庫伺服器
- 適用於 PostgreSQL 的 Azure 資料庫伺服器
- 適用於 PostgreSQL 的 Azure 資料庫 Server V2
- 適用於 MariaDB 的 Azure 資料庫伺服器
- 裝置佈建服務
- ExpressRoute 線路
- 前門
- 網路介面
- 網路安全性群組
- 公用 IP 位址
- 流量管理員設定檔
- 虛擬網路閘道
- 虛擬私人網路閘道
- 虛擬網路
- 搜尋服務
- 串流分析作業
資料行
資料行 | 類型 | 描述 |
---|---|---|
action_id_s | String | |
action_name_s | String | |
action_s | String | |
ActivityId_g | Guid | |
AdditionalFields | ||
AdHocOrScheduledJob_s | String | |
application_name_s | String | |
audit_schema_version_d | Double | |
avg_cpu_percent_s | String | |
avg_mean_time_s | String | |
backendHostname_s | String | |
Caller_s | String | |
callerId_s | String | |
CallerIPAddress | String | |
calls_s | String | |
類別 | String | |
client_ip_s | String | |
clientInfo_s | String | |
clientIP_s | String | |
clientIp_s | String | |
clientIpAddress_s | String | |
clientPort_d | Double | |
code_s | String | |
collectionName_s | String | |
conditions_destinationIP_s | String | |
conditions_destinationPortRange_s | String | |
conditions_None_s | String | |
conditions_protocols_s | String | |
conditions_sourceIP_s | String | |
conditions_sourcePortRange_s | String | |
CorrelationId | String | |
count_executions_d | Double | |
cpu_time_d | Double | |
database_name_s | String | |
database_principal_name_s | String | |
DatabaseName_s | String | |
db_id_s | String | |
direction_s | String | |
dop_d | Double | |
duration_d | Double | |
duration_milliseconds_d | Double | |
DurationMs | BigInt | |
ElasticPoolName_s | String | |
endTime_t | Datetime | |
Environment_s | String | |
error_code_s | String | |
error_message_s | String | |
errorLevel_s | String | |
event_class_s | String | |
event_s | String | |
event_subclass_s | String | |
event_time_t | Datetime | |
EventName_s | String | |
execution_type_d | Double | |
executionInfo_endTime_t | Datetime | |
executionInfo_exitCode_d | Double | |
executionInfo_startTime_t | Datetime | |
host_s | String | |
httpMethod_s | String | |
HTTPStatus_d | Double | |
httpStatusCode_d | Double | |
HTTPStatusCode_s | String | |
httpVersion_s | String | |
id_s | String | |
identity_claim_appid_g | Guid | |
identity_claim_ipaddr_s | String | |
instanceId_s | String | |
interval_end_time_d | Double | |
interval_start_time_d | Double | |
ip_s | String | |
is_column_permission_s | String | |
isAccessPolicyMatch_b | Bool | |
JobDurationInSecs_s | String | |
JobFailureCode_s | String | |
JobId_g | Guid | |
jobId_s | String | |
JobOperation_s | String | |
JobOperationSubType_s | String | |
JobStartDateTime_s | String | |
JobStatus_s | String | |
JobUniqueId_g | Guid | |
層級 | String | |
log_bytes_used_d | Double | |
logical_io_reads_d | Double | |
logical_io_writes_d | Double | |
LogicalServerName_s | String | |
macAddress_s | String | |
matchedConnections_d | Double | |
max_cpu_time_d | Double | |
max_dop_d | Double | |
max_duration_d | Double | |
max_log_bytes_used_d | Double | |
max_logical_io_reads_d | Double | |
max_logical_io_writes_d | Double | |
max_num_physical_io_reads_d | Double | |
max_physical_io_reads_d | Double | |
max_query_max_used_memory_d | Double | |
max_rowcount_d | Double | |
max_time_s | String | |
mean_time_s | String | |
訊息 | String | |
min_time_s | String | |
msg_s | String | |
num_physical_io_reads_d | Double | |
object_id_d | Double | |
object_name_s | String | |
OperationName | String | |
OperationVersion | String | |
partitionKey_s | String | |
physical_io_reads_d | Double | |
plan_id_d | Double | |
policy_s | String | |
policyMode_s | String | |
primaryIPv4Address_s | String | |
priority_d | Double | |
properties_enabledForDeployment_b | Bool | |
properties_enabledForDiskEncryption_b | Bool | |
properties_enabledForTemplateDeployment_b | Bool | |
properties_s | String | |
properties_sku_Family_s | String | |
properties_sku_Name_s | String | |
properties_tenantId_g | Guid | |
query_hash_s | String | |
query_id_d | Double | |
query_max_used_memory_d | Double | |
query_plan_hash_s | String | |
query_time_d | Double | |
querytext_s | String | |
receivedBytes_d | Double | |
Region_s | String | |
requestCharge_s | String | |
requestQuery_s | String | |
requestResourceId_s | String | |
requestResourceType_s | String | |
requestUri_s | String | |
reserved_storage_mb_s | String | |
資源 | String | |
resource_actionName_s | String | |
resource_location_s | String | |
resource_originRunId_s | String | |
resource_resourceGroupName_s | String | |
resource_runId_s | String | |
resource_subscriptionId_g | Guid | |
resource_triggerName_s | String | |
resource_workflowId_g | Guid | |
resource_workflowName_s | String | |
ResourceGroup | String | |
_ResourceId | String | 記錄相關資源的唯一識別碼。 |
ResourceProvider | String | |
ResourceProvider | String | |
ResourceType | String | |
ResourceType | String | |
response_rows_d | Double | |
resultCode_s | String | |
ResultDescription | String | |
ResultDescription | String | |
resultDescription_ChildJobs_s | String | |
resultDescription_ErrorJobs_s | String | |
resultMessage_s | String | |
ResultSignature | String | |
ResultType | String | |
ResultType | String | |
rootCauseAnalysis_s | String | |
routingRuleName_s | String | |
rowcount_d | Double | |
ruleName_s | String | |
RunbookName_s | String | |
RunOn_s | String | |
schema_name_s | String | |
sentBytes_d | Double | |
sequence_group_id_g | Guid | |
sequence_number_d | Double | |
server_principal_sid_s | String | |
session_id_d | Double |
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應