pub struct CorrelationEngine { /* private fields */ }Expand description
The correlation engine evaluates events against loaded rules using sliding windows.
Implementations§
Source§impl CorrelationEngine
impl CorrelationEngine
Sourcepub fn new(rules: Vec<CorrelationRule>) -> Result<Self>
pub fn new(rules: Vec<CorrelationRule>) -> Result<Self>
Create a new correlation engine, pre-compiling all regex patterns.
Sourcepub fn process_event(&mut self, event: &TimelineEvent) -> Vec<Alert>
pub fn process_event(&mut self, event: &TimelineEvent) -> Vec<Alert>
Process a single event against all loaded rules. Evicts expired windows first, then evaluates conditions. Returns any alerts that were generated.
Sourcepub fn evict_expired_at(&mut self, now: DateTime<Utc>)
pub fn evict_expired_at(&mut self, now: DateTime<Utc>)
Remove window states that have exceeded their rule’s window duration, using the given reference time (typically the current event’s timestamp).
Sourcepub fn evict_expired(&mut self)
pub fn evict_expired(&mut self)
Remove window states that have exceeded their rule’s window duration using wall-clock time.
Sourcepub fn evict_expired_capped(&mut self, max_window: Duration)
pub fn evict_expired_capped(&mut self, max_window: Duration)
Remove window states that have exceeded the shorter of the rule’s own
window duration and the provided max_window cap, using wall-clock time.
Sourcepub fn rules(&self) -> &[CorrelationRule]
pub fn rules(&self) -> &[CorrelationRule]
Return a reference to the loaded rules.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CorrelationEngine
impl RefUnwindSafe for CorrelationEngine
impl Send for CorrelationEngine
impl Sync for CorrelationEngine
impl Unpin for CorrelationEngine
impl UnsafeUnpin for CorrelationEngine
impl UnwindSafe for CorrelationEngine
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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