0
votes

I'm trying to create a custom log alert with this query:

traces
| where message contains "Setup"
| extend Proposal = tostring(split(split(tostring(message), " ]")[1], ": ")[1])
| summarize AggregatedValue=count() by Time=bin(ago(24h), 1h), Proposal 

But I'm getting the error

Search Query should contain 'AggregatedValue' and 'bin(timestamp, [roundTo])' for Metric alert type

Since I have both requirements of the error, why am I getting it?

1
Could you please try to use summarize AggregatedValue=count() by bin(ago(24h), 1h), Proposal? Besides, could you please describe your issue in detail?Jim Xu

1 Answers

0
votes

Hello and welcome to Stack Overflow!

I tried a similar log query with the same constructs and was able to create a custom log alert successfully. This could be a one-off issue. I'd suggest you to give it another try and see if the error recurs. Else you could also try creating it via other alternate options like ARM templates, Powershell, CLI or REST APIs, as detailed in this doc.