Jul 19 2020
08:45 PM
- last edited on
Apr 08 2022
10:34 AM
by
TechCommunityAP
Jul 19 2020
08:45 PM
- last edited on
Apr 08 2022
10:34 AM
by
TechCommunityAP
Hello All,
I'm using the below script to get the backup information, but in this script I can't found were or how can I get the error message, error code and the recommendations message.
Can anyone help me on this? :)
let Events = AzureDiagnostics
| where Category == "AzureBackupReport" ;
Events
| where OperationName == "Job" and JobOperation_s == "Backup"
| project ProtectedServerUniqueId_s, JobStatus_s, Resource , TimeGenerated , JobStartDateTime_s , JobDurationInSecs_s
| join kind=inner
(
Events
| where OperationName == "ProtectedServer"
| where ProtectedServerFriendlyName_s != ""
| distinct ProtectedServerUniqueId_s, ProtectedServerFriendlyName_s
| project ProtectedServerUniqueId_s, ProtectedServerFriendlyName_s
)
on ProtectedServerUniqueId_s
| project ProtectedServerFriendlyName_s, JobStatus_s, Resource, TimeGenerated , JobStartDateTime_s , JobDurationInSecs_s
| extend Vault= Resource
| summarize count() by ProtectedServerFriendlyName_s, JobStatus_s, Vault, TimeGenerated , JobStartDateTime_s , JobDurationInSecs_s
Jul 20 2020 07:18 AM
If you remove the filters, like this, do you see the Columns of data you need? I don't see names like Error message or error code but they may have other names? If you find the right data you can add them to the Project and Distinct lines
let Events = AzureDiagnostics
| where Category == "AzureBackupReport" ;
Events
| where OperationName == "Job" and JobOperation_s == "Backup"
//| project ProtectedServerUniqueId_s, JobStatus_s, Resource , TimeGenerated , JobStartDateTime_s , JobDurationInSecs_s
| join kind=inner
(
Events
| where OperationName == "ProtectedServer"
| where ProtectedServerFriendlyName_s != ""
//| distinct ProtectedServerUniqueId_s, ProtectedServerFriendlyName_s
//| project ProtectedServerUniqueId_s, ProtectedServerFriendlyName_s
)
on ProtectedServerUniqueId_s
//| project ProtectedServerFriendlyName_s, JobStatus_s, Resource, TimeGenerated , JobStartDateTime_s , JobDurationInSecs_s
| extend Vault= Resource
Jul 20 2020 08:44 AM
Hello @CliveWatson
Tks for your help.
So, all scripts doesn't show the recommendation. I'm trying to find this message on the below screen:
I'm trying use the "RecommendedAction_s", but doesn't show any information.
let Events = AzureDiagnostics
| where Category == "AzureBackupReport"; Events
| extend JobOperationSubType_s = columnifexists("JobOperationSubType_s", "")
| where OperationName == "Job" and JobOperation_s == "Backup" and JobStatus_s == "Failed" and JobOperationSubType_s != "Log" and JobOperationSubType_s != "Recovery point_Log"
| distinct JobUniqueId_g, BackupItemUniqueId_s, JobStatus_s, Resource, JobFailureCode_s, JobStartDateTime_s, RecommendedAction_s
| project BackupItemUniqueId_s, JobStatus_s, Resource, JobFailureCode_s, JobStartDateTime_s, RecommendedAction_s
Jul 22 2020 02:55 AM
.
That is an "Alert" operation so you need to add that. ie.
let Events = AzureDiagnostics
| where Category == "AzureBackupReport";
Events
| extend JobOperationSubType_s = columnifexists("JobOperationSubType_s", "")
| where OperationName == "Alert" or OperationName == "Job"
and JobOperation_s == "Backup" and JobStatus_s == "Failed"
and JobOperationSubType_s !in ("Log","Recovery point_Log")
| distinct JobUniqueId_g, BackupItemUniqueId_s, JobStatus_s, Resource, JobFailureCode_s, JobStartDateTime_s, RecommendedAction_s
| project BackupItemUniqueId_s, JobStatus_s, Resource, JobFailureCode_s, JobStartDateTime_s, RecommendedAction_s
Jul 24 2020 06:31 AM
Hi Clive,
I´m trying to achieve the same here. Tested the amended query, but no luck on getting the Error Message or the Recommended Action yet.
Quest continues...
Jul 24 2020 06:40 AM
SolutionJul 27 2020 02:12 PM
Tried the same, but neither Error Message nor Recommended action are returned by this query.
Jul 29 2020 09:58 AM
Jul 30 2020 01:48 AM
That's correct, question is still open until you are happy or our collective knowledge is exhausted. I see this data with the query I provided. You can see it working in the demo data set here:
Go to Log Analytics and run query
As to why you don't have it, perhaps its the back up type or other issue. I'm not familiar with backup, so perhaps others will comment?
Aug 31 2020 01:55 PM
Hi, I used your query and it works fine. Can you please add lines to display database backups (SQL in Azure VM)
Jul 24 2020 06:40 AM
Solution