diff --git a/read_log.py b/read_log.py index 4ea23e7..5ff9a87 100644 --- a/read_log.py +++ b/read_log.py @@ -3,6 +3,14 @@ import pandas as pd + +def __get_404_response_count(df): + """ + Provide the total amount of requests that have a '404' not found status code. + """ + return len(df[df["status_code"] == "404"]) + + methods = ["GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS", "TRACE", "PATCH"] pattern = r'^([\d.]+) - - \[([^]]+)\] "([^"]*)" (\d+) (\d+) "([^"]*)" "([^"]*)" "-"$'