ARM Template for KQL Query Alert

Copper Contributor

Hi,

I have query that is supposed to get the data related to Security Updates and Critical Updates from devices connected to Log Analytics workspace.

This query works fine in one Log Analytics workspace but shows a syntax error in another Log Analytics workspace while configuring an alert.
Security Update Query
Update | where UpdateState == 'Needed' and Optional == false and Classification == 'Security Updates' and Approved != false | summarize AggregatedValue = count() by Computer
Critical Updates Query
Update | where UpdateState == 'Needed' and Optional == false and Classification == 'Critical Updates' and Approved != false | summarize count() by Computer


Need help in finding why this query shows a syntax error while i use it for configuring an alert.


Thanks in Advance

 

3 Replies

@Consultant1350 

 

Both of these work in the free demo workspace, see that here:

 

Go to Log Analytics and Run Query

 

What error do you get and which of the two queries gets the error?  Do they work as a query but one fails when put into an Alert?

@CliveWatson 
Hi,

Thanks for your response. I am getting a Syntax error while trying to execute this query from the Logs to get the data and also while configuring an alert using this query.
Please find the screenshot attached for the reference.

@Consultant1350 

 

You normally get that error if the table doesn't exist - so do you definitely you have Update in that workplace?  

Update
| limit 10

 

 

Annotation 2019-06-24 200251.jpg