Top Client IPs From an Access Log
During an incident you keep running awk | sort | uniq -c | sort -rn | head on access logs. Turn it into a tool the team can rely on. The starter is /home/student/logs/top_ips.py; a sample log is next to it.
python3 top_ips.py LOGFILE N
N client IPs with the most requests, one per line, as COUNT IP (for example 42 10.0.3.7).N different IPs, print them all.About this machine
Ubuntu 24.04 with no internet access. You are student with passwordless sudo. The grader checks the final state of the machine, not the commands you typed. Values like names and ports are generated for you.
Part of Python for DevOps. Next step: Totals per Column From a Real CSV
Teaching or writing about this? Embed this lab on your page
Your machine is ready to start
A fresh, isolated Ubuntu machine boots in a few seconds with the task already set up.
No account needed: 3 of 3 free tries left. Guest machines last 30 minutes.