@ -33,7 +33,7 @@ class Log:
def is_new_log ( log_line ) :
def is_new_log ( log_line ) :
# The assumption is that a new log will start with a date printed in
# The assumption is that a new log will start with a date printed in
# the below regex format.
# the below regex format.
date_regex = " \ d {4} / \ d {2} / \ d {2} - \ d {2} : \ d {2} : \ d {2} \ . \ d {6} " # noqa
date_regex = " \ d {4} / \ d {2} / \ d {2} - \ d {2} : \ d {2} : \ d {2} \ . \ d {6} " # noqa
return re . match ( date_regex , log_line )
return re . match ( date_regex , log_line )
def __init__ ( self , log_line , column_families ) :
def __init__ ( self , log_line , column_families ) :
@ -46,7 +46,7 @@ class Log:
# "2018/07/25-17:29:05.176080 7f969de68700 [db/compaction_job.cc:1634]
# "2018/07/25-17:29:05.176080 7f969de68700 [db/compaction_job.cc:1634]
# [default] [JOB 3] Compacting 24@0 + 16@1 files to L1, score 6.00\n"
# [default] [JOB 3] Compacting 24@0 + 16@1 files to L1, score 6.00\n"
for col_fam in column_families :
for col_fam in column_families :
search_for_str = " \ [ " + col_fam + " \ ] " # noqa
search_for_str = " \ [ " + col_fam + " \ ] " # noqa
if re . search ( search_for_str , self . message ) :
if re . search ( search_for_str , self . message ) :
self . column_family = col_fam
self . column_family = col_fam
break
break