changed no outpu rule parse result with -s option #343

This commit is contained in:
DustInDark
2021-12-23 15:45:11 +09:00
parent acaae4b328
commit 716e0a182a
2 changed files with 6 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ use crate::detections::print::AlertMessage;
use crate::detections::print::ERROR_LOG_STACK; use crate::detections::print::ERROR_LOG_STACK;
use crate::detections::print::MESSAGES; use crate::detections::print::MESSAGES;
use crate::detections::print::QUIET_ERRORS_FLAG; use crate::detections::print::QUIET_ERRORS_FLAG;
use crate::detections::print::STATISTICS_FLAG;
use crate::detections::rule; use crate::detections::rule;
use crate::detections::rule::AggResult; use crate::detections::rule::AggResult;
use crate::detections::rule::RuleNode; use crate::detections::rule::RuleNode;
@@ -273,6 +274,9 @@ impl Detection {
parseerror_count: &u128, parseerror_count: &u128,
ignore_count: &u128, ignore_count: &u128,
) { ) {
if *STATISTICS_FLAG {
return;
}
let mut total = parseerror_count + ignore_count; let mut total = parseerror_count + ignore_count;
rc.into_iter().for_each(|(key, value)| { rc.into_iter().for_each(|(key, value)| {
println!("{} rules: {}", key, value); println!("{} rules: {}", key, value);

View File

@@ -228,11 +228,13 @@ impl AlertMessage {
for error_log in ERROR_LOG_STACK.lock().unwrap().iter() { for error_log in ERROR_LOG_STACK.lock().unwrap().iter() {
writeln!(error_log_writer, "{}", error_log).ok(); writeln!(error_log_writer, "{}", error_log).ok();
} }
println!("");
println!( println!(
"Errors were generated. Please check {} for details.", "Errors were generated. Please check {} for details.",
ERROR_LOG_PATH.to_string() ERROR_LOG_PATH.to_string()
); );
println!(""); println!("");
println!("");
} }
/// ERRORメッセージを表示する関数 /// ERRORメッセージを表示する関数