Oct 08 2018
03:53 AM
- last edited on
Apr 07 2022
05:30 PM
by
TechCommunityAP
Oct 08 2018
03:53 AM
- last edited on
Apr 07 2022
05:30 PM
by
TechCommunityAP
Hi Team,
I want to generate alert when backup job is running more than 3 hours. But not sure how to Create this but I am sure we can create this since when I are running below query. We have JobDurationInSecs_s (in seconds) in output.
I tried to generate alert using below query but not able to run this. Pleas let me know how I can do this
AzureDiagnostics
| where Category == "AzureBackupReport"
| where JobDurationInSecs_s >= 140000
Thanks in advance for the help :)
Oct 08 2018 10:31 AM
there are 10,800 seconds in 3 hours...
140,000sec is 38.89 days...
Oct 08 2018 10:00 PM
ohhh..Sorry Sir, It was a typo. My Bad :p
I tried two queries.
First is :-
AzureDiagnostics | where Category == 'AzureBackupReport' | where OperationName == 'Job' | where JobDurationInSecs_s == 33641.4431761
It is running and generating output.
But when i am using below query to generate alert then it is throwing an error message
Cannot compare values of types string and real. Try adding explicit casts.
AzureDiagnostics | where Category == 'AzureBackupReport' | where OperationName == 'Job' | where JobDurationInSecs_s >= 33641.4431761
I used >, gt, in place of >= but no luck
Oct 10 2018 02:39 PM
SolutionYou can see by the name of the column that it is a string. The "_s" suffix tells you this.
to convert it to a double for comparison call the todouble function.
AzureDiagnostics | where Category == 'AzureBackupReport' | where OperationName == 'Job'
| where todouble(JobDurationInSecs_s) >= 33641.4