{"id":27096136,"url":"https://github.com/aldotobing/nginx-access-log-analyzer","last_synced_at":"2025-04-06T09:33:01.620Z","repository":{"id":263396572,"uuid":"890268174","full_name":"aldotobing/nginx-access-log-analyzer","owner":"aldotobing","description":"This project is a Bash script designed to analyze Nginx access logs and generate a detailed HTML dashboard with key metrics related to web traffic, security, and performance. The script parses the Nginx access logs to gather insights.","archived":false,"fork":false,"pushed_at":"2025-02-20T07:27:24.000Z","size":154,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-20T08:27:56.928Z","etag":null,"topics":["analyzer","bash","bash-script","logger","logging","nginx","reverse-proxy"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aldotobing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-11-18T09:32:01.000Z","updated_at":"2025-02-20T07:29:04.000Z","dependencies_parsed_at":"2025-02-03T07:29:15.175Z","dependency_job_id":"1c145f1b-fe4b-465c-a332-37331bcc6561","html_url":"https://github.com/aldotobing/nginx-access-log-analyzer","commit_stats":null,"previous_names":["aldotobing/nginx-qccess-log-analyzer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldotobing%2Fnginx-access-log-analyzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldotobing%2Fnginx-access-log-analyzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldotobing%2Fnginx-access-log-analyzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldotobing%2Fnginx-access-log-analyzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aldotobing","download_url":"https://codeload.github.com/aldotobing/nginx-access-log-analyzer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247463744,"owners_count":20942935,"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":["analyzer","bash","bash-script","logger","logging","nginx","reverse-proxy"],"created_at":"2025-04-06T09:32:06.827Z","updated_at":"2025-04-06T09:33:01.594Z","avatar_url":"https://github.com/aldotobing.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nginx Access Log Analyzer and Dashboard Generator\n\n![Preview Image](./nginx-analyze.png)\n\nThis project is a Bash script designed to analyze Nginx access logs and generate a detailed HTML dashboard with key metrics related to web traffic, security, and performance. The script parses the Nginx access logs to gather insights such as:\n\n- **Request Count:** Total number of requests received.\n- **Unique IPs:** List of unique client IPs making requests.\n- **Error Counts:** Number of HTTP error responses (e.g., 4xx, 5xx errors).\n- **Security Analysis:** Detection of potential security issues, including:\n  - SQL Injection attempts\n  - Directory Traversal attempts\n  - Cross-Site Scripting (XSS) attempts\n- **Top IPs and URLs:** Identifies the most frequent IP addresses and URLs accessed, useful for identifying possible sources of traffic spikes or security threats.\n\nAdditionally, the script fetches **IP location data** from [**ipinfo.io**](https://ipinfo.io) to provide geographical details for the client IPs. The final output is an interactive HTML dashboard that can be used for both traffic analysis and security monitoring.\n\n### Nginx Standard Log Format\n\nThe script analyzes the **Nginx access log** format.\n\nThis log line contains the following fields:\n\n1. **IP address**: `192.168.1.1` – The client's IP address.\n2. **Timestamp**: `[18/Nov/2024:15:27:36 +0000]` – The time of the request.\n3. **Request**: `\"GET /index.html HTTP/1.1\"` – The HTTP request made.\n4. **Status Code**: `200` – The HTTP status code returned.\n5. **Response Size**: `3054` – The size of the response body in bytes.\n6. **Referrer**: `\"https://example.com/\"` – The referrer URL.\n7. **User Agent**: `\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36\"` – The user agent string representing the browser making the request.\n\n## Features:\n\n- Parses Nginx access logs.\n- Detects common web security vulnerabilities.\n- Provides detailed statistics on requests and errors.\n- Retrieves IP geolocation data for further analysis.\n- Generates a user-friendly HTML dashboard with interactive tables and charts.\n\n## Requirements:\n\n- Bash\n- `jq` (for parsing JSON data)\n- `curl` (for fetching IP geolocation data)\n- Access to Nginx access logs.\n\n## Installation:\n\nClone the repository and run the script from the command line:\n\n```bash\ngit clone https://github.com/aldotobing/nginx-access-log-analyzer.git\ncd nginx-access-log-analyzer\n./nginx-today-log.sh\n```\n\n## Download Log Option:\n\nFor future analysis, the script includes an option to download the logs. This allows users to keep a record of past logs and perform historical analysis.\n\n## License\n\nThis project is licensed under the [MIT License](./LICENSE).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faldotobing%2Fnginx-access-log-analyzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faldotobing%2Fnginx-access-log-analyzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faldotobing%2Fnginx-access-log-analyzer/lists"}