pub fn add_log_line(&mut self, log_line: &str) -> Option<&LogCluster> {
        let processed_line = self.apply_overall_pattern(log_line);
        let tokens = DrainTree::process(
            &self.filter_patterns,
            processed_line.unwrap_or_else(|| log_line.to_string()),
        );
        let len = tokens.len();
        let log_tokens = tokens.as_slice();
        let log_cluster_option = self
            .root
            .entry(len)
            .or_insert_with(|| Node::inner(0))
            .add_child_recur(
                0,
                &self.max_depth,
                &self.max_children,
                &self.min_similarity,
                log_tokens,
            );
        if let Some(log_cluster) = log_cluster_option {
            log_cluster.extract_variables(log_tokens);
            // println!("log_cluster => {}", log_cluster);
            // println!("log_cluster => {}", log_cluster.as_string());
        }
        log_cluster_option
    }
/// Add a new log line to the overall tree and return the current
/// reference to the created/modified log cluster
///
/// Over time, the log clusters could change as new log lines are added.
/// ```
/// let mut drain = drain_rs::DrainTree::new();
/// assert!(drain.add_log_line("[Sun Dec 04 04:51:08 2005] [notice] jk2_init() Found child 6725 in scoreboard slot 10").is_some());
///  ```
Add a new log line to the overall tree and return the current
reference to the created/modified log cluster

Over time, the log clusters could change as new log lines are added.
Add a new log line to the overall tree and return the current reference to the created / modified log cluster Over time the log clusters could change as new log lines are added .
pub fn add_log_line(&mut self, log_line: &str) -> Option<&LogCluster> {
        let processed_line = self.apply_overall_pattern(log_line);
        let tokens = DrainTree::process(
            &self.filter_patterns,
            processed_line.unwrap_or_else(|| log_line.to_string()),
        );
        let len = tokens.len();
        let log_tokens = tokens.as_slice();
        let log_cluster_option = self
            .root
            .entry(len)
            .or_insert_with(|| Node::inner(0))
            .add_child_recur(
                0,
                &self.max_depth,
                &self.max_children,
                &self.min_similarity,
                log_tokens,
            );
        if let Some(log_cluster) = log_cluster_option {
            log_cluster.extract_variables(log_tokens);
            // println!("log_cluster => {}", log_cluster);
            // println!("log_cluster => {}", log_cluster.as_string());
        }
        log_cluster_option
    }
pub fn add_log_line ( & mut self , log_line : & str ) -> Option < & LogCluster > { let processed_line = self . apply_overall_pattern ( log_line ) ; let tokens = DrainTree :: process ( & self . filter_patterns , processed_line . unwrap_or_else ( | | log_line . to_string ( ) ) , ) ; let len = tokens . len ( ) ; let log_tokens = tokens . as_slice ( ) ; let log_cluster_option = self . root . entry ( len ) . or_insert_with ( | | Node :: inner ( 0 ) ) . add_child_recur ( 0 , & self . max_depth , & self . max_children , & self . min_similarity , log_tokens , ) ; if let Some ( log_cluster ) = log_cluster_option { log_cluster . extract_variables ( log_tokens ) ; // println!("log_cluster => {}", log_cluster); // println!("log_cluster => {}", log_cluster.as_string()); } log_cluster_option }
Add a new log line to the overall tree and return the current
reference to the created/modified log cluster
Add a new log line to the overall tree and return the current reference to the created / modified log cluster
&mut self
log_line
&str
&mut self
log_line
&str