diff --git a/http_log_watcher/log_watcher.py b/http_log_watcher/log_watcher.py index 7217922..2e38728 100644 --- a/http_log_watcher/log_watcher.py +++ b/http_log_watcher/log_watcher.py @@ -3,10 +3,11 @@ import requests import time import logging +from datetime import datetime REMOTE_HOST = 'http://ec2-54-193-126-147.us-west-1.compute.amazonaws.com:3000' - +FEBRUARY_DATE_TIME = datetime(2018, 2, 1) def get_logfile_list(ctl_name): mac_log_dict = dict() @@ -65,6 +66,11 @@ def run_processing_log_files_of_all_directories(db): else: raise ValueError("Invalid HTTP logfile, the file should start with 'http' or 'https'") + parsed_datetime = datetime.strptime(date_string, "%Y-%m-%d") + + if FEBRUARY_DATE_TIME > parsed_datetime: + continue + # check whether to process the file file_last_modified_time = get_file_last_modified_time(file_path) last_time_line = get_last_time_processed_line(db, file_path)