1

Kusto 使用 re2 库:https ://github.com/google/re2/wiki/Syntax ,如此处所述:https : //docs.microsoft.com/en-us/azure/kusto/query/re2 所以显然是环视不支持。

示例字符串:一些句子。一些词 一些词 ServiceInstanceId:78d61d2f-6df9-4ba4-a192-0713d3cd8a82.1234 未找到。, ErrorCode:2 一些句子。一些句子。一些句子。

是否可以从 Kusto 中的上述字符串中提取 78d61d2f-6df9-4ba4-a192-0713d3cd8a82。需要“ServiceInstanceId:”之后的所有字符,直到下一个空格。

4

1 回答 1

1

您可以使用parse

let MyTable = datatable(s:string) [
    "Sample String:Some sentence. Some word Some word ServiceInstanceId:78d61d2f-6df9-4ba4-a192-0713d3cd8a82.1234 not found. , ErrorCode:2 Some sentences. Some sentences.Some sentences."
];
MyTable
| parse s with * "ServiceInstanceId:" ServiceInstanceId " " *

结果:

s 服务实例 ID
示例字符串:一些句子。一些词 一些词 ServiceInstanceId:78d61d2f-6df9-4ba4-a192-0713d3cd8a82.1234 未找到。, ErrorCode:2 一些句子。一些句子。一些句子。 78d61d2f-6df9-4ba4-a192-0713d3cd8a82.1234

注意:您要求提取到下一个空格,因此答案应该是“78d61d2f-6df9-4ba4-a192-0713d3cd8a82 .1234”,而不仅仅是“78d61d2f-6df9-4ba4-a192-0713d3cd8a82”。

于 2021-12-30T13:57:09.073 回答