{"id":16544203,"url":"https://github.com/cs01/nginx_log_analyzer","last_synced_at":"2026-05-29T01:31:56.637Z","repository":{"id":220908887,"uuid":"752902887","full_name":"cs01/nginx_log_analyzer","owner":"cs01","description":null,"archived":false,"fork":false,"pushed_at":"2024-02-05T06:54:22.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-14T11:16:52.154Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/cs01.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-02-05T04:15:55.000Z","updated_at":"2024-02-05T04:21:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"50d00cf9-0ed9-4f63-ab15-c875635fabf3","html_url":"https://github.com/cs01/nginx_log_analyzer","commit_stats":{"total_commits":1,"total_committers":1,"mean_commits":1.0,"dds":0.0,"last_synced_commit":"84432525540d0c1586afbc672c6414ecd5f06500"},"previous_names":["cs01/nginx_log_analyzer-"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cs01%2Fnginx_log_analyzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cs01%2Fnginx_log_analyzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cs01%2Fnginx_log_analyzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cs01%2Fnginx_log_analyzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cs01","download_url":"https://codeload.github.com/cs01/nginx_log_analyzer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241801256,"owners_count":20022390,"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":[],"created_at":"2024-10-11T19:01:21.919Z","updated_at":"2026-05-29T01:31:51.608Z","avatar_url":"https://github.com/cs01.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nginx Log Analyzer\n\n## Overview\n\nAnalyzes Nginx access logs to provide insights into traffic. It parses nginx logs to determine the number of unique visitors per day and provides a summary of total visitors over the analyzed period.\n\n**Defaults**\n\n- No side effects, no temp files, no db writes\n- Parses pattern `/var/log/nginx/access.log*`, including .gz files\n\n**Options**\n\n- Pass `--write-db` to create or update a simple sqlite database, containing date and visitor count.\n- Specify db path with `--database \u003cpath\u003e` to override default\n\n## Build\n\n```\ncargo build --release\n```\n\nNote: if you get `/usr/bin/ld: cannot find -lsqlite3 collect2: error: ld returned 1 exit status`, you'll need the sqlite3 development package:\n\nDebian/Ubuntu:\n\n```\nsudo apt-get install libsqlite3-dev\n```\n\nRed Hat/Fedora/CentOS-based systems:\n\n```\nsudo yum install sqlite-devel\n```\n\nArch linux:\n\n```\nsudo pacman -S sqlite\n```\n\nmacOS:\n\n```\nbrew install sqlite\n```\n\n## Run\n\n```\n\u003e sudo ./target/release/nginx_log_analyzer --write-db\n2024-01-22: 3426 unique visitors\n2024-01-23: 2385 unique visitors\n2024-01-24: 2386 unique visitors\n2024-01-25: 2426 unique visitors\n2024-01-26: 2353 unique visitors\n2024-01-27: 1979 unique visitors\n2024-01-28: 1581 unique visitors\n2024-01-29: 1529 unique visitors\n2024-01-30: 1553 unique visitors\n2024-01-31: 2076 unique visitors\n2024-02-01: 4380 unique visitors\n2024-02-02: 5785 unique visitors\n2024-02-03: 7820 unique visitors\n2024-02-04: 7512 unique visitors\n2024-02-05: 2569 unique visitors\nTotal unique visitors across all days: 49760, over 15 days\n```\n\n## Test\n\n```\n cargo run -- --pattern test/example.log\n    Finished dev [unoptimized + debuginfo] target(s) in 0.02s\n     Running `target/debug/nginx_log_analyzer --pattern test/example.log`\n2024-01-29: 1 unique visitors\n2024-01-30: 1 unique visitors\n2024-02-01: 1 unique visitors\n2024-02-02: 2 unique visitors\n2024-02-03: 1 unique visitors\n2024-02-04: 1 unique visitors\nTotal unique visitors across all days: 7, over 6 days\n```\n\n## API\n\n```\ntarget/debug/nginx_log_analyzer --help\nNginx Log Analyzer 1.0\nChad Smith\nAnalyzes Nginx logs to count unique visitors per day and provide a summary.\n\nUSAGE:\n    nginx_log_analyzer [FLAGS] [OPTIONS]\n\nFLAGS:\n    -h, --help        Prints help information\n    -V, --version     Prints version information\n        --write-db    Enables writing the summary to the SQLite database\n\nOPTIONS:\n    -d, --database \u003cDATABASE\u003e    Sets the path to the SQLite database file [default: nginxaccess.db]\n    -p, --pattern \u003cPATTERN\u003e      Sets the pattern to search for log files, including .gz files [default:\n                                 /var/log/nginx/access.log*]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcs01%2Fnginx_log_analyzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcs01%2Fnginx_log_analyzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcs01%2Fnginx_log_analyzer/lists"}