我正在努力实现这些目标:
- 获取某些字段的最新数据(基于时间戳)-> 调用这个 latestRequest
- 获取这些字段的先前数据(基本上是时间戳<latestRequest.timestamp)-> 调用此previousRequest
- 计算 latestRequest 和 previousRequest 之间的差异
这就是我现在带来的:
let LatestRequest=requests
| where operation_Name == "SearchServiceFieldMonitor"
| extend Mismatch = split(tostring(customDimensions.IndexerMismatch), " in ")
| extend difference = toint(Mismatch[0])
, field = tostring(Mismatch[1])
, indexer = tostring(Mismatch[2])
, index = tostring(Mismatch[3])
, service = tostring(Mismatch[4])
| summarize MaxTime=todatetime(max(timestamp)) by service,index,indexer;
let previousRequest = requests
| where operation_Name == "SearchServiceFieldMonitor"
| extend Mismatch = split(tostring(customDimensions.IndexerMismatch), " in ")
| extend difference = toint(Mismatch[0])
, field = tostring(Mismatch[1])
, indexer = tostring(Mismatch[2])
, index = tostring(Mismatch[3])
, service = tostring(Mismatch[4])
|join (LatestRequest) on indexer, index,service
|where timestamp <LatestRequest.MaxTime
但是,我从这个查询中得到这个错误:
确保表达式:LatestRequest.MaxTime 确实是一个简单的名称
我尝试使用toDateTime(LatestRequest.MaxTime)
,但它没有任何区别。我做错了什么?