File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed
backend/src/main/java/com/park/utmstack Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 11# UTMStack 10.5.16 Release Notes
22## Bugfix
3- - False positive alerts displayed in Dashboard Overview
3+ - False positive alerts displayed in Dashboard Overview
4+ - Correct query parsing for filterType conditions with special characters
Original file line number Diff line number Diff line change 44import com .fasterxml .jackson .annotation .JsonIgnore ;
55import com .fasterxml .jackson .core .JsonProcessingException ;
66import com .fasterxml .jackson .core .type .TypeReference ;
7+ import com .fasterxml .jackson .databind .JsonNode ;
78import com .fasterxml .jackson .databind .ObjectMapper ;
9+ import com .fasterxml .jackson .databind .node .ObjectNode ;
810import com .park .utmstack .domain .chart_builder .types .query .FilterType ;
911import com .park .utmstack .web .rest .vm .AlertTagRuleVM ;
1012import org .springframework .util .StringUtils ;
@@ -147,8 +149,16 @@ public void setRuleAppliedTags(String ruleAppliedTags) {
147149 public List <FilterType > getConditions () throws JsonProcessingException {
148150 if (StringUtils .hasText (ruleConditions )) {
149151 ObjectMapper om = new ObjectMapper ();
150- conditions = om .readValue (ruleConditions , new TypeReference <>() {
152+
153+ JsonNode rootNode = om .readTree (ruleConditions );
154+
155+ rootNode .forEach (node -> {
156+ JsonNode valueNode = node .get ("value" );
157+ if (valueNode != null && valueNode .asText ().contains (":" )) {
158+ ((ObjectNode ) node ).put ("value" , valueNode .asText ().replace (":" , "\\ :" ));
159+ }
151160 });
161+ conditions = om .convertValue (rootNode , new TypeReference <>() {});
152162 }
153163 return conditions ;
154164 }
Original file line number Diff line number Diff line change @@ -33,7 +33,6 @@ public Long countAlertsByStatus(int status) {
3333
3434 List <FilterType > filters = new ArrayList <>();
3535 filters .add (new FilterType (Constants .alertStatus , OperatorType .IS , status ));
36- filters .add (new FilterType (Constants .alertTags , OperatorType .IS_NOT , Constants .FALSE_POSITIVE_TAG ));
3736
3837 SearchRequest .Builder srb = new SearchRequest .Builder ();
3938 srb .query (SearchUtil .toQuery (filters ))
You can’t perform that action at this time.
0 commit comments