diff --git a/agent/database.py b/agent/database.py index 13ece353..b53fc8a0 100644 --- a/agent/database.py +++ b/agent/database.py @@ -30,7 +30,7 @@ def search_binary_log( f"mysqlbinlog --short-form --database {database} " f"--start-datetime '{start_datetime}' " f"--stop-datetime '{stop_datetime}' " - f" {log} | grep -Piv '{LINES_TO_SKIP}' | head -n {max_lines}" + f" {log} | grep -Piv '{LINES_TO_SKIP}'" ) DELIMITER = "/*!*/;" @@ -55,6 +55,8 @@ def search_binary_log( ), } ) + if len(events) > max_lines: + break return events @property