Skip to content

Commit

Permalink
fix: sort count result filed value
Browse files Browse the repository at this point in the history
  • Loading branch information
fukusuket committed Nov 2, 2024
1 parent 2ebd810 commit 487a377
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/detections/detection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1067,12 +1067,14 @@ impl Detection {
// この関数が呼び出されている段階で既にaggregation conditionは存在する前提なのでagg_conditionの配列の長さは2となる
let agg_condition = rule.get_agg_condition().unwrap();
write!(ret, "Count:{}", agg_result.data).ok();
let mut sorted_filed_values = agg_result.field_values.clone();
sorted_filed_values.sort();
if agg_condition._field_name.is_some() {
write!(
ret,
" ¦ {}:{}",
agg_condition._field_name.as_ref().unwrap(),
agg_result.field_values.join("/")
sorted_filed_values.join("/")
)
.ok();
}
Expand Down

0 comments on commit 487a377

Please sign in to comment.