You have an Azure subscription that contains a Log Analytics workspace named Workspace1 and two Recovery Services vaults named Vault1 and Vault2.
You configure diagnostic settings for both vaults to send logs to Workspace1. The configurations are as follows:
* For Vault1, you select the Azure diagnostics (legacy) option.
* For Vault2, you select the Resource specific option.
For both vaults, you enable the AddonAzureBackupJobs log category.
You need to write a Kusto Query Language (KQL) query that returns a consolidated list of all failed backup jobs from both vaults.
Which KQL query should you run?
- union
(AzureDiagnostics
| where Category == "AddonAzureBackupJobs" and JobStatus_s == "Failed"
| project TimeGenerated, VaultName = VaultName_s, JobStatus = JobStatus_s),
(AddonAzureBackupJobs
| where JobStatus == "Failed"
| project TimeGenerated, VaultName, JobStatus)Cevap - Bunion
(AzureDiagnostics
| where Category == "AddonAzureBackupJobs" and JobStatus == "Failed"
| project TimeGenerated, VaultName, JobStatus),
(AddonAzureBackupJobs
| where JobStatus == "Failed"
| project TimeGenerated, VaultName, JobStatus) - CAddonAzureBackupJobs
| where JobStatus == "Failed"
| project TimeGenerated, VaultName, JobStatus - DAzureDiagnostics
| where Category == "AddonAzureBackupJobs" and JobStatus_s == "Failed"
| project TimeGenerated, VaultName = VaultName_s, JobStatus = JobStatus_s
Cevap
The correct query combines the legacy AzureDiagnostics table (using suffixed columns like JobStatus_s and VaultName_s for Vault1) and the dedicated AddonAzureBackupJobs table (using standard column names for Vault2) using a union operator.
The correct answer accurately queries both tables where the logs reside. Vault1 logs are stored in the AzureDiagnostics table because it uses the legacy diagnostics setting. Within this table, the columns have suffixes (JobStatus_s and VaultName_s). Vault2 logs are stored in the AddonAzureBackupJobs table because it uses the Resource-specific setting, and its columns are unsuffixed. The query merges them using a union and projects the columns to align their schemas.
Adım Adım Çözüm
Anahtar Kavram
Azure Backup diagnostic logging modes (Azure diagnostics vs Resource specific) and their impact on Log Analytics table routing and column schemas.
Tahmini Süre:3m 0s