我试图通过Kusto/KQL聚合生成一个帐户名列表(尝试、失败和成功)。
预期的结果很简单--一列字符串值,按升序按字母顺序排序。
因为它在10k结果之后切断了我,所以我现在正在研究块/分页这个结果集的方法。
对于每个页面请求,我认为我应该获取列表中的姓氏,并将其附加到下一个查询(| where AccountName > "bob.saget"
)中。
Kusto不允许我这样做;它会产生一个Cannot compare values of types string and string. Try adding explicit casts
错误。
发布于 2021-05-24 12:29:55
虽然您最初的问题(如何按字典顺序比较字符串)的答案是使用strcmp()
函数,但实际上您需要的是分页,这是另一个故事:)
在Kusto中执行分页的正确途径是使用存储查询结果。
检索第一页如下:
.set stored_query_result GiveItSomeName with (previewCount = 100) <|
// Your query comes here
DeviceLogonEvents
| where isnotempty(AccountName)
| summarize by AccountName
| order by AccountName asc
// Add a row number
| project RowNum = row_number()
检索下一页如下:
stored_query_result("GiveItSomeName")
| where RowNum between (100 .. 200)
等。
发布于 2021-05-24 10:58:26
迂回的做事方式,但strcmp
来救。
DeviceLogonEvents
| where isnotempty(AccountName)
| summarize by AccountName
| order by AccountName asc
| where strcmp(AccountName, 'bob.saget') > -1
https://stackoverflow.com/questions/67677558
复制