fixed logic #301
This commit is contained in:
@@ -2,6 +2,7 @@ extern crate csv;
|
||||
|
||||
use crate::detections::configs;
|
||||
use crate::detections::print::AlertMessage;
|
||||
use crate::detections::print::ERROR_LOG_PATH;
|
||||
use crate::detections::print::MESSAGES;
|
||||
use crate::detections::rule;
|
||||
use crate::detections::rule::AggResult;
|
||||
@@ -12,6 +13,8 @@ use crate::yaml::ParseYaml;
|
||||
use hashbrown;
|
||||
use serde_json::Value;
|
||||
use std::collections::HashMap;
|
||||
use std::fs::File;
|
||||
use std::io::BufWriter;
|
||||
use tokio::{runtime::Runtime, spawn, task::JoinHandle};
|
||||
|
||||
use std::sync::Arc;
|
||||
@@ -59,7 +62,7 @@ impl Detection {
|
||||
rulefile_loader.read_dir(rulespath.unwrap_or(DIRPATH_RULES), &level, exclude_ids);
|
||||
if result_readdir.is_err() {
|
||||
AlertMessage::alert(
|
||||
&mut std::io::stderr().lock(),
|
||||
&mut BufWriter::new(File::open(ERROR_LOG_PATH.to_string()).unwrap()),
|
||||
format!("{}", result_readdir.unwrap_err()),
|
||||
true,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user