目前,我正在 Azure 中构建一个监控,并在图表中进行日志查询。 到目前为止,这工作正常,但我有一个问题。如果我想在图表中显示零值,我就会遇到问题。 当我查询 Count 时,我只得到包含数据的值。
我尝试了以下方法来输出零值:
customEvents
| where name == "GlobalHostHandleMessageError" and tolower(customDimensions.MessageType) in ("listmanager")
| where customDimensions.DeliveryCount == "10"
| project MessageType = customDimensions.MessageType, timestamp
| summarize SumMessages=count() by tostring(MessageType), timestamp
| make-series count() default=0 on timestamp in range(ago(1d), now(), 1h) by MessageType
| mvexpand timestamp, count_
不幸的是,我无法在“make-series”命令之后显示图表。显示以下错误:
FAILED TO CREATE VISUALIZATION
The Pie can't be created as you are missing a column of one of the following types: int, long, decimal or real
谁能帮我解决这个问题吗?
提前致以问候和感谢
最佳答案
mvexpand 的输出始终是动态类型列。尝试将最后一行更改为:
mvexpand 时间戳,tolong(count_)
。
关于Azure 日志查询显示空值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60398189/