我正在尝试将一些逻辑从主查询中移到lambda中,以便主查询更容易阅读。
所以我想采取这样的逻辑:
[17-12-23 12:33:02:470 CST] 23:01:00
我想将T //columns: operation_Name
| extend path_Label = iif(operation_Name == '/', 'home', 'other')
//end up with columns: operation_Name, path_Label
逻辑移到lambda中:
iif
也尝试过:
let translate_path = (operation_Name: string)
{
iif(operation_Name == '/', 'home', 'other')
};
T
| extend path_Label = invoke translate_path(operation_Name)
答案 0 :(得分:1)
没有必要添加"调用"。没有它,你的第一次尝试应该可以正常工作:
let translate_path = (operation_Name: string)
{
iif(operation_Name == '/', 'home', 'other')
};
T
| extend path_Label = translate_path(operation_Name)