Bladeren bron

预警规则判断优化

zhaoxian 4 jaren geleden
bovenliggende
commit
7af7501e97
1 gewijzigde bestanden met toevoegingen van 4 en 4 verwijderingen
  1. 4 4
      module-alarm/src/main/java/cn/com/ctop/alarm/modules/constant/MatchLogic.java

+ 4 - 4
module-alarm/src/main/java/cn/com/ctop/alarm/modules/constant/MatchLogic.java

@@ -56,7 +56,7 @@ public class MatchLogic {
                     case "less_equal":
                         return bigVal.compareTo(bigThr) <= 0;
                     default:
-                        log.warn("关系不匹配");
+                        log.warn("关系不匹配 type={},condition={},threshold={},value={},", type, condition, threshold, value);
                         break;
                 }
             } else if ("string".equals(type)) {
@@ -66,11 +66,11 @@ public class MatchLogic {
                     case "not_equal":
                         return !value.equals(threshold);
                     case "contain":
-                        return !value.contains(threshold);
+                        return threshold.contains(value);
                     case "no_contain":
-                        return !value.contains(threshold);
+                        return !threshold.contains(value);
                     default:
-                        log.warn("关系不匹配");
+                        log.warn("关系不匹配 type={},condition={},threshold={},value={},", type, condition, threshold, value);
                         break;
                 }
             } else {