我正在尝试创建一个查询,该查询将显示VM上缺少的关键更新和安全更新,但只能从15天前开始,但不能在15天内进行。所以我创建了这个查询..。
Update
| where Classification in ("Security Updates", "Critical Updates")
| where UpdateState == 'Needed' and Optional == false and Approved == true
| where TimeGenerated > ago(15d)
| summarize count() by Classification, Computer, _ResourceId
但是当我运行这个查询时,它会在15天内给出丢失的更新,但是我试图实现的是15天前丢失的更新。
如有任何贡献,将不胜感激。谢谢
发布于 2022-10-16 21:41:06
每天都会多次报告更新事件。您需要过滤最后一个报告并检查PublishedDate。
Update
| where TimeGenerated > ago(1d)
| where PublishedDate < ago(15d)
| where Classification in ("Security Updates", "Critical Updates")
| where Optional == false
| summarize arg_max(TimeGenerated, Classification, UpdateState, Approved) by KBID, Computer, _ResourceId
| where UpdateState == 'Needed' and Approved == true
| summarize dcount(KBID) by Classification, Computer, _ResourceId
发布于 2022-10-16 22:08:35
TimeGenerated < ago(15d)
。Timegenerated > ago(15d)
作为过滤条件时,将显示15天前到今天的数据。我试图在Azure数据资源管理器中复制示例表Covid19_map2。此表具有日期时间类型的LastRefreshed列。ago()函数应用于这个LastRefreshed列,并在lastRefreshed >ago(15d)和lastRefreshed
lastRefreshed >ago(15d):
没有任何数据在15天内被刷新。所以这里没有要显示的行。
lastRefreshed < ago(15d):
显示超过15天的数据。
参考微软关于以前功能的文档。
https://stackoverflow.com/questions/74091745
复制相似问题