Monitoring bash Intermediate

Nginx Access Log Analyser

Parse Nginx access logs and report top IPs, endpoints, and status codes.

bash
#!/bin/bash
LOG=${1:-/var/log/nginx/access.log}
echo '=== Top 10 IPs ==='
awk '{print $1}' $LOG | sort | uniq -c | sort -rn | head -10
echo '=== Status Codes ==='
awk '{print $9}' $LOG | sort | uniq -c | sort -rn

Prerequisites

  • awk
  • sort
  • uniq

Pro Tips

  • → Pipe to goaccess for a live dashboard.

Was this module useful?

Share your experience — it helps the team improve.

Leave Feedback

Commercial Licensing

Acquire a production access token or template license for enterprise deployment.

Module Info

Language
bash
Level
Intermediate
Read time
2 min
Published
Apr 2025
License
Commercial License

Newsletter

New modules every week, directly to your inbox.