fixed logic #301

This commit is contained in:
DustInDark
2021-12-19 16:43:35 +09:00
parent 7f9f2349f2
commit 97b12fc068
5 changed files with 64 additions and 38 deletions

View File

@@ -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,
)