Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions read_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -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+) "([^"]*)" "([^"]*)" "-"$'

Expand Down