Question 30
Scenario 3:
You are provided with a Gzipped Apache log file from a website having the below data in each row.
The fields are separated by spaces and quoted by double quotes ("). Unlike CSV files, quoted fields are escaped via " and not". All data is in the GMT-0500 timezone and the questions were based in this same time zone.
Use the information and answer the given sub-questions.
Note: Assume that you are using Python codes for log analysis
After filtering the log entries (in a list filtered_entries), which of the following is the best way to count the number of requests with a 404 status code for pages under /error/?
Use len(filtered_entries)
Use len(entries)
Use sum(1 for entry in entries)
None of these