{"id":26028587,"url":"https://github.com/kaalpanikh/nginx-log-analyser","last_synced_at":"2026-04-18T01:37:33.749Z","repository":{"id":275524351,"uuid":"926334847","full_name":"kaalpanikh/nginx-log-analyser","owner":"kaalpanikh","description":"Tool for analyzing Nginx logs to extract metrics, error stats, and traffic insights.","archived":false,"fork":false,"pushed_at":"2025-03-06T06:25:24.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-06T07:37:03.813Z","etag":null,"topics":["analytics","log-analyzer","monitoring","nginx"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kaalpanikh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-03T04:00:51.000Z","updated_at":"2025-03-06T06:25:27.000Z","dependencies_parsed_at":"2025-02-03T05:19:51.240Z","dependency_job_id":"93329cc5-662e-4560-8568-f50f5127a123","html_url":"https://github.com/kaalpanikh/nginx-log-analyser","commit_stats":null,"previous_names":["kaalpanikh/nginx-log-analyser"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaalpanikh%2Fnginx-log-analyser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaalpanikh%2Fnginx-log-analyser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaalpanikh%2Fnginx-log-analyser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaalpanikh%2Fnginx-log-analyser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaalpanikh","download_url":"https://codeload.github.com/kaalpanikh/nginx-log-analyser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242250929,"owners_count":20096898,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytics","log-analyzer","monitoring","nginx"],"created_at":"2025-03-06T17:18:46.198Z","updated_at":"2025-09-17T16:06:46.639Z","avatar_url":"https://github.com/kaalpanikh.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nginx Log Analyser\n\nA command-line tool built with shell scripting to analyze Nginx access logs. This project processes a given access log file and outputs valuable statistics, including the top 5 IP addresses, requested paths, response status codes, and user agents.\n\n## Table of Contents\n\n- [Overview](#overview)\n- [Project Page](#project-page)\n- [Features](#features)\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Enhancements](#enhancements)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Overview\n\nThe Nginx Log Analyser is designed to help you learn basic shell scripting while working with real-world data. By parsing the standard Nginx access log (in combined log format), the script extracts and summarizes key information about website traffic.\n\n## Project Page\n\nFor more details and project inspiration, visit the [Nginx Log Analyser project page](https://roadmap.sh/projects/nginx-log-analyser).\n\n## Features\n\n- **Top 5 IP Addresses:** Identifies the IP addresses making the most requests.\n- **Top 5 Requested Paths:** Lists the most frequently requested resources.\n- **Top 5 Response Status Codes:** Summarizes HTTP status codes returned by the server.\n- **Top 5 User Agents:** Provides insight into which browsers or bots are accessing your server.\n\n## Requirements\n\n- A Unix-like operating system (Linux, macOS, etc.)\n- Basic knowledge of shell scripting and command-line usage.\n- Tools: `awk`, `sort`, `uniq`, `head`\n\n## Installation\n\n1. **Clone the Repository:**\n\n   ```bash\n   git clone https://github.com/kaalpanikh/nginx-log-analyser.git\n   cd nginx-log-analyser\n   ```\n\n2. **Download the Log File (Optional):**\n\n   If you want to test with a real log file, download the sample log file:\n\n   ```bash\n   curl -o access.log \"https://gist.githubusercontent.com/kamranahmedse/e66c3b9ea89a1a030d3b739eeeef22d0/raw/77fb3ac837a73c4f0206e78a236d885590b7ae35/nginx-access.log\"\n   ```\n\n3. **Make the Script Executable:**\n\n   ```bash\n   chmod +x nginx_log_analyser.sh\n   ```\n\n## Usage\n\nRun the script by providing the path to your access log file:\n\n```bash\n./nginx_log_analyser.sh access.log\n```\n\nThe output will display the following statistics:\n- Top 5 IP addresses\n- Top 5 requested paths\n- Top 5 response status codes\n- Top 5 user agents\n\n## Enhancements\n\nOnce you have the basic functionality working, consider these enhancements:\n- Add error handling for missing or malformed log files.\n- Format output as CSV or JSON for easier integration with other tools.\n- Extend the script to analyze additional data such as referrers or daily traffic.\n- Experiment with alternative tools like `grep` or `sed` for parsing.\n\n## Contributing\n\nContributions are welcome! Feel free to fork the repository and submit pull requests. For major changes, please open an issue first to discuss your ideas.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\nHappy scripting and analyzing!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaalpanikh%2Fnginx-log-analyser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaalpanikh%2Fnginx-log-analyser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaalpanikh%2Fnginx-log-analyser/lists"}