PerlbeginnercliAI generated

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

  1. 01

    Parse log lines with regex

    ~1.5h

    Write a regex to extract IP, timestamp, request path, and status code from each log line.

  2. 02

    Aggregate counts in hashes

    ~1.5h

    Use hashes to tally occurrences of IPs, status codes, and paths as lines are processed.

  3. 03

    Sort and format the report

    ~1.5h

    Sort hash entries by count and print a formatted top-N summary for each category.

  4. 04

    Add command-line options

    ~1h

    Use Getopt::Long to let the user specify the log file and top-N count.

  5. 05

    Test against sample logs

    ~1h

    Run 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.

~6.5h · 5 steps

Tech stack

Perl core modules