azure-log-analytics - Kusto 查询中的案例语句
问题描述
我的表中有一大串代码,我已经使用 != 将其中一些代码静音/排除了
我想检查特定错误代码的条件,如下所示。并且还想要我在表格中的其他代码。
exceptions
| extend A_= tostring(customDimensions.A)
| extend B_ = tostring(customDimensions.B)
| where B_ != '21000' //exclude
| where B_ != '30000' //exclude
| where B_ != '40000' //exclude
| where B_ == "80000"
and A_ != "abcd"
and A_ != "wxyz"
将 B_ == "80000" 与 "and" 运算符一起使用的问题是,它只输出代码 80000 的列表,其中没有我想要的那两个字符串。但我也想输出我没有在查询中排除的其他代码。
到目前为止,我已经尝试使用如下的 case 语句;
| where error_code_ != case(B_ != "80000", A_ != "abcd" , A_ != "wxyz")
但这并没有像我预期的那样工作。不确定查询有什么问题,或者是否有更好的解决方案。
解决方案
只需使用or
运算符:
exceptions
| extend A_= tostring(customDimensions.A)
| extend B_ = tostring(customDimensions.B)
| where B_ != '21000' //exclude
| where B_ != '30000' //exclude
| where B_ != '40000' //exclude
| where (B_ == "80000" and A_ != "abcd" and A_ != "wxyz") or B_ !="80000"
推荐阅读
- flutter - Flutter 应用程序以“flutter run”运行,但在同一设备上安装 apk 时失败
- angular - 为什么我的测验结果显示不正确?
- bash - 百组号
- ios - 问题在 NSUserDefaults 中存储“收藏夹”按钮状态
- mysql - Mac (Mojave) 上的 MySQL 服务器突然停止并且不会重新启动
- r - r studio中的频率/计数变量
- pandas - 将 CSV 文件与列乱序组合
- ios - 从数组中获取文本到 UITableViewCell
- android - 我正在尝试在 TextView 中输出一个 .docx 文件并为我显示它,我该如何修复它?
- javascript - 如何将大 1gb+ csv 渲染为 html 表