Forum Discussion
Alert on Backup Jobs
- Oct 10, 2018
You 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 https://docs.microsoft.com/en-us/azure/kusto/query/todoublefunctionfunction.
AzureDiagnostics | where Category == 'AzureBackupReport' | where OperationName == 'Job'
| where todouble(JobDurationInSecs_s) >= 33641.4
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
You 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 https://docs.microsoft.com/en-us/azure/kusto/query/todoublefunctionfunction.
AzureDiagnostics | where Category == 'AzureBackupReport' | where OperationName == 'Job'
| where todouble(JobDurationInSecs_s) >= 33641.4