From 80d219d97517ac6c097cfe96c32670757b56dc16 Mon Sep 17 00:00:00 2001 From: fukusuket <41001169+fukusuket@users.noreply.github.com> Date: Wed, 10 Jul 2024 21:41:47 +0900 Subject: [PATCH] fix: Top 5 computers with most unique detections's output --- src/afterfact.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/afterfact.rs b/src/afterfact.rs index 9afbbe688..321afec26 100644 --- a/src/afterfact.rs +++ b/src/afterfact.rs @@ -549,16 +549,18 @@ fn calc_statistic_info( } let computer_names = match &detect_info.agg_result { None => vec![detect_info.computername.clone()], - Some(agg) => agg.agg_record_time_info.iter().map(|a| CompactString::from(a.computer.clone())) .collect::>() // Convert to HashSet to remove duplicates + Some(agg) => agg + .agg_record_time_info + .iter() + .map(|a| CompactString::from(a.computer.clone())) + .collect::>() // Convert to HashSet to remove duplicates .into_iter() .sorted() - .collect() + .collect(), }; for computername in &computer_names { - let computer_rule_check_key = CompactString::from(format!( - "{}|{}", - computername, &detect_info.rulepath - )); + let computer_rule_check_key = + CompactString::from(format!("{}|{}", computername, &detect_info.rulepath)); println!("{:?}", computer_rule_check_key); if !afterfact_info .detected_computer_and_rule_names