Skip to content

Commit

Permalink
fix: Top 5 computers with most unique detections's output
Browse files Browse the repository at this point in the history
  • Loading branch information
fukusuket committed Jul 10, 2024
1 parent a8f9236 commit 80d219d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/afterfact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<std::collections::HashSet<_>>() // Convert to HashSet to remove duplicates
Some(agg) => agg
.agg_record_time_info
.iter()
.map(|a| CompactString::from(a.computer.clone()))
.collect::<std::collections::HashSet<_>>() // 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
Expand Down

0 comments on commit 80d219d

Please sign in to comment.