Kusto 使用 re2 庫:https : //github.com/google/re2/wiki/Syntax,如下所述:https : //docs.microsoft.com/en-us/azure/kusto/query/re2 顯然是lookarounds不支持。
示例字串:一些句子。一些詞 一些詞 ServiceInstanceId:78d61d2f-6df9-4ba4-a192-0713d3cd8a82.1234 未找到。, ErrorCode:2 一些句子。一些句子,一些句子。
是否可以從 Kusto 中的上述字串中提取 78d61d2f-6df9-4ba4-a192-0713d3cd8a82。需要“ServiceInstanceId:”之后的所有字符,直到下一個空格。
uj5u.com熱心網友回復:
您可以使用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 " " *
結果:
| 秒 | 服務實體 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”。
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/398867.html
標籤:解析 文本 千斤顶 kusto-explorer
下一篇:DIR但選擇檔案名的特定部分
