Log File Parser and Summary Reporter
Build a script that parses web server access logs, extracts key fields with regular expressions, and prints a summary report of top IPs, status codes, and requested paths. Learners practice Perl regex, hashes for counting, and file handling.
- Estimate
- ~6.5h
- Steps
- 5
- Completed by
- 0
- Proposed by
- codeseed.app
Perl core modules
Project roadmap
- 01
Parse log lines with regex
~1.5hWrite a regex to extract IP, timestamp, request path, and status code from each log line.
- 02
Aggregate counts in hashes
~1.5hUse hashes to tally occurrences of IPs, status codes, and paths as lines are processed.
- 03
Sort and format the report
~1.5hSort hash entries by count and print a formatted top-N summary for each category.
- 04
Add command-line options
~1hUse Getopt::Long to let the user specify the log file and top-N count.
- 05
Test against sample logs
~1hRun the script against sample Apache/Nginx log files and verify counts are correct.
Resources
Ready to build this?
Get a GitHub repo and start building. Your AI reviewer checks each step as you go.
Tech stack