在Kusto中​​替换GUID

问题描述

如何替换无值的Kusto查询中的所有GUID。

例如

我的数据看起来像

/ page / 1d58e797-a905-403f-ebd9-27ccf3f1d2cd / user / 4d58e797-a905-403f-ebd9-27ccf3f1d2c3

我想要

/页面//用户/

解决方法

您可以使用replace功能。另外,您可以测试正则表达式here

let input = '/page/1d58e797-a905-403f-ebd9-27ccf3f1d2cd/user/4d58e797-a905-403f-ebd9-27ccf3f1d2c3';
let rx = '[({]?[a-fA-F0-9]{8}[-]?([a-fA-F0-9]{4}[-]?){3}[a-fA-F0-9]{12}[})]?';
print replace(rx,'',input);
,

尝试使用以下正则表达式将删除网址中的guid(8-4-4-4-12)

 let regex =/(\/[\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})(\b|\/)/g