Appinsight 中的子串

Substring in appinsight

如何在 Microsoft AppInsight Analytics 中找到子字符串?

我有这个模板名称的活动: "FinalStep-Start: 12:11:20.467 | End: 12:11:20.936" 我想把这两个时间分开,然后相互比较。

您可以使用 "parse" 运算符将开始时间和结束时间解析到它们自己的列中:

| parse eventText with * "FinalStep-Start: " start " | End: " end

但是因为 datetimes are not in a standard supported by analytics 我无法将它们转换为 DateTime 进行进一步处理:

range x from 1 to 1 step 1
| extend eventText = "FinalStep-Start: 12:11:20.467 | End: 12:11:20.936"
| parse eventText with * "FinalStep-Start: " start " | End: " end
| extend start_dt = todatetime(start) 
| extend end_dt = todatetime(end)