pub struct LogcheckDatabase {
pub cracking_rules: RuleSet,
pub cracking_ignore: RuleSet,
pub violations_rules: RuleSet,
pub violations_ignore: RuleSet,
pub system_events: RuleSet,
pub workstation: RuleSet,
pub server: RuleSet,
pub local: RuleSet,
}Fields§
§cracking_rules: RuleSet§cracking_ignore: RuleSet§violations_rules: RuleSet§violations_ignore: RuleSet§system_events: RuleSet§workstation: RuleSet§server: RuleSet§local: RuleSetImplementations§
Source§impl LogcheckDatabase
impl LogcheckDatabase
Sourcefn convert_posix_classes(pattern: &str) -> String
fn convert_posix_classes(pattern: &str) -> String
Convert POSIX character classes to Rust regex equivalents Logcheck rules use POSIX classes like [[:alnum:]], [[:digit:]], etc. which are not supported by Rust’s regex crate
This now uses the centralized regex_conversion module
Sourcepub fn load_from_directory<P: AsRef<Path>>(
base_path: P,
) -> Result<Self, RuleError>
pub fn load_from_directory<P: AsRef<Path>>( base_path: P, ) -> Result<Self, RuleError>
Load logcheck database from traditional directory structure
Sourcefn load_rule_directory(
dir_path: &Path,
rule_set: &mut RuleSet,
) -> Result<(), RuleError>
fn load_rule_directory( dir_path: &Path, rule_set: &mut RuleSet, ) -> Result<(), RuleError>
Load all rule files from a directory
Sourcefn load_rule_file(
file_path: &Path,
rule_set: &mut RuleSet,
) -> Result<(), RuleError>
fn load_rule_file( file_path: &Path, rule_set: &mut RuleSet, ) -> Result<(), RuleError>
Load a single rule file
Sourcepub fn compile_all(&mut self) -> Result<(), RuleError>
pub fn compile_all(&mut self) -> Result<(), RuleError>
Compile all rule sets for efficient matching
Sourcepub fn match_message(&self, message: &str) -> Option<RuleCategory>
pub fn match_message(&self, message: &str) -> Option<RuleCategory>
Match a log message against logcheck rules Returns the rule category if matched, following logcheck precedence
Trait Implementations§
Source§impl Clone for LogcheckDatabase
impl Clone for LogcheckDatabase
Source§fn clone(&self) -> LogcheckDatabase
fn clone(&self) -> LogcheckDatabase
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LogcheckDatabase
impl Debug for LogcheckDatabase
Auto Trait Implementations§
impl Freeze for LogcheckDatabase
impl RefUnwindSafe for LogcheckDatabase
impl Send for LogcheckDatabase
impl Sync for LogcheckDatabase
impl Unpin for LogcheckDatabase
impl UnwindSafe for LogcheckDatabase
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more