- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有两个表,它们都包含某个实体的运行状况事件。表 1 包含间隔几分钟的频繁事件。表 2 的时间间隔可能从几分钟到几个月不等。我想将表 2 中某个实体的最新健康事件关联到表 1。
let Table1 = datatable (Table1Timestamp : datetime, Table1NameOfDataElement : string)
[
datetime(2021-05-11 19:05:00), 'foo',
datetime(2021-05-11 19:15:00), 'foo',
datetime(2021-05-11 19:12:00), 'foo',
datetime(2021-05-11 19:09:00), 'bar',
datetime(2021-05-11 19:15:00), 'bar',
];
let Table2 = datatable (Table2Timestamp : datetime, Table2NameOfDataElement : string, Other: int)
[
// Data is ragged, days before first entry but is current state of 'foo'
datetime(2021-05-09 19:05:00), 'foo', 1,
datetime(2021-05-09 19:05:00), 'bar', 2,
datetime(2021-05-11 19:09:00), 'bar', 3,
];
Table1
| where Table1Timestamp between (datetime(2021-05-11 19:00:00) .. datetime(2021-05-11 20:00:00))
// determine state of entity in table 1 every 10 minutes
| summarize arg_max(Table1Timestamp, *) by Table1NameOfDataElement, TimeInterval = bin(Table1Timestamp, 10minutes)
// Find the row in table2 that is closest in time proximity to the row from table 1
// This naive approach will not compile
| extend MostRecentColumnInOtherTable = toscalar(Table2
| where Table2Timestamp < **Table1Timestamp**
| where Table2NameOfDataElement == **Table1NameOfDataElement**
| top 1 by Table2Timestamp | project Other)
我不能这样做,因为 kql 不允许我在内部查询中引用外部查询中的列。我可以加入实体名称,但这只能解决一半问题,我需要查找表 1 中事件之前的最后一个条目。
一种简单的方法是加入 bin(Table2Timestamp, 10minutes) == bin(table1Timestamp, 10minutes)
但表 2 中的数据可能与表 1 中的相关行相距数月,表 2 仅记录发生时的状态变化。
表 1 的窗口很窄,通常包含数千行。 Table2 可以追溯到很多个月并包含数十万行。
如何快速查找 table2 中发生在 table1 行之前的最后一次更改?
最佳答案
找到了适合我的东西。只需对实体名称进行连接,然后与 arg_min 聚合以查找时间戳差异最小的行
let Table1 = datatable (Table1Timestamp : datetime, Table1NameOfDataElement : string)
[
datetime(2021-05-11 19:05:00), 'foo',
datetime(2021-05-11 19:15:00), 'foo',
datetime(2021-05-11 19:12:00), 'foo',
datetime(2021-05-11 19:09:00), 'bar',
datetime(2021-05-11 19:15:00), 'bar',
];
let Table2 = datatable (Table2Timestamp : datetime, Table2NameOfDataElement : string, Other: int)
[
// Data is ragged, days before first entry but is current state of 'foo'
datetime(2021-05-09 19:05:00), 'foo', 1,
datetime(2021-05-09 19:05:00), 'bar', 2,
datetime(2021-05-11 19:09:00), 'bar', 3,
];
Table1
| where Table1Timestamp between (datetime(2021-05-11 19:00:00) .. datetime(2021-05-11 20:00:00))
// determine state of entity in table 1 every 10 minutes
| summarize arg_max(Table1Timestamp, *) by Table1NameOfDataElement, TimeInterval = bin(Table1Timestamp, 10minutes)
// Find the row in table2 that is closest in time proximity to the row from table 1
// This naive approach will not compile
| Lookup Table2 on $left.Table1NameOfDataElement == $right.Table1NameOfDataElement
| where Table1Timestamp < Table2Timestamp
| summarize arg_min(TimeDiffFromTimestamp = datetime_diff('second', Table1Timestamp, Table2Timestamp), *) by bin(Table1TimeStamp), Table1NameOfDataElement
关于azure - 如何从 AzureDataExplorer/Kusto 中的子查询引用外部查询以进行过滤+扩展?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67812932/
我使用了以下软件包 import pandas as pd from azure.kusto.data import KustoClient, KustoConnectionStringBuilder
我正在尝试使用 C# 建立与 Azure DataExplorer 群集的连接。我在 https://learn.microsoft.com/en-us/azure/kusto/api/netfx/a
我有一个 Kusto 图表,其中有来自查询的变量名称(平台)的图例。我想从此图例中删除附加文本。我做了一些研究,并且能够从 SQL 中看到类似的结果,但您能否告诉我如何在 KQL 中执行此操作。 例如
我遇到了以下问题,并且在线进行了大量搜索没有提供任何好的结果。当尝试访问我的 Azure 数据资源管理器数据库并在 Azure 函数中使用 Kusto.Data SDK 进行查询时,会产生以下错误:
我遇到了以下问题,并且在线进行了大量搜索没有提供任何好的结果。当尝试访问我的 Azure 数据资源管理器数据库并在 Azure 函数中使用 Kusto.Data SDK 进行查询时,会产生以下错误:
希望定义一个变量来保存查询的输出,然后从中查询跟踪。像这样: let start=datetime("2020-10-07T15:01:00.000Z"); let end=datetime("202
我们在使用 Azure Kusto 中的时间图表时遇到一些问题。在此图表中,我们对一段时间内的 http 异常进行了分组。 问题在于图表仍然报告不存在异常的时间点的最后看到的值。参见红色标记。在这个特
如何在 Kusto 中执行自定义排序顺序? 示例查询: //==================================================// // Assign variabl
我绝对可以使用“//”来注释每一行,但想知道是否有办法避免这样做。 最佳答案 迄今为止(2020-07-10) - 不支持。 可以提出/赞成功能请求@https://aka.ms/adx.uservo
我得到的错误是“无法创建该行,因为缺少以下类型之一的列:int、long、decimal 或 real” 这是我的查询”我正在查看图表将显示“随着时间的推移,唯一资源 ID 的数量,聚合时间跨度为 5
如何获取所有资源组的资源组名称、订阅名称和 ID? 我可以获取所有资源组 Resources| distinct resourceGroup 但是如果我在其中添加“id”,我会多次获得相同的资源组。
我有一个简单的问题,但尚未找到解决方案。我正在使用 Azure 数据资源管理器,我需要一个 kusto 查询,将相似的行分组在一起,并与原始行一起输出集群。目前,我使用的聚类函数包括 autoclus
我正在尝试在 kusto 函数内使用摄取代码将记录插入到 kusto 表中。我在运行查询时看到以下错误。是否可以选择在 kusto 函数内使用摄取? .create function with (do
我需要编写一个查询来查看 15 天以上的结果。我有这段代码,我在其中获取时间跨度格式的 avg_duration (15.04:01:02)。我现在想根据 avg_duration 进行过滤,只返回
我在 KUSTO 上进行了此搜索,但在转换为百分位数时遇到问题。我可以转换为千兆/秒,但不能转换为百分位。当我这样做时,我只获得总数的百分位,而不是每个的百分位。非常感谢任何帮助。 AzureMetr
我需要运行一个非常简单的查询 requests | where cloud_RoleName == "blabla" | summarize Count=count() by url | order
我有以下脚本: let StartTime = datetime(2022-02-18 10:10:00 AM); let EndTime = datetime(2022-02-18 10:15:00
我正在使用 Azure Monitor 日志从应用见解中查询页面 View 。对 customDimensions 字段执行 Kusto 查询时,以下内容不会返回任何结果: pageViews | w
我正在使用以下 Kusto 查询从应用洞察日志导出日志 traces | extend request = parse_json(tostring(parse_json(customDimension
我想编写 kusto 查询,如果变量中存在三个记录,该查询基本上不会返回任何结果。这是一个例子: let someValues = datatable (name: string) [
我是一名优秀的程序员,十分优秀!