This project provides a Bash script to analyze Nginx access logs. The script extracts and displays the top 5 entries for IP addresses, requested paths, response status codes, and user agents.
- Bash
- Nginx access log file with fields: IP address, Date and time, Request method/path, Status code, Response size, Referrer, User agent.
- Clone the repository:
git clone https://github.com/your-username/nginx-log-analyzer.git cd nginx-log-analyzer - Make the script executable:
chmod +x nginx_log_analyzer.sh
- Run the script with the path to your log file:
./nginx_log_analyzer.sh /path/to/nginx-access.log
- The script will output:
- Top 5 IP addresses with the most requests
- Top 5 most requested paths
- Top 5 response status codes
- Top 5 user agents