Dav*_*New 2 azure-application-insights azure-log-analytics
我无法将查询中的标量日期值设置为局部变量。我收到以下错误:
SYNTAX ERROR
No tabular expression statement found
Run Code Online (Sandbox Code Playgroud)
询问:
let startTime = toscalar(customMetrics
| where timestamp > ago(1d)
| summarize min(timestamp));
Run Code Online (Sandbox Code Playgroud)
仅运行查询时我得到的结果很好:
我究竟做错了什么?
您需要使用此函数执行语句/查询,否则它只是一个不会被调用的函数定义。最简单的一个是 print 命令,但您也可以在某些查询中调用该函数:
let startTime = toscalar(customMetrics
| where timestamp > ago(10m)
| summarize min(timestamp));
print startTime
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1054 次 |
| 最近记录: |