{"id":35553644,"url":"https://github.com/tabalt/access-log-analysis","last_synced_at":"2026-01-04T08:02:32.103Z","repository":{"id":21711237,"uuid":"25032744","full_name":"tabalt/access-log-analysis","owner":"tabalt","description":"Access log analysis","archived":false,"fork":false,"pushed_at":"2014-12-04T10:18:38.000Z","size":151,"stargazers_count":81,"open_issues_count":0,"forks_count":24,"subscribers_count":8,"default_branch":"master","last_synced_at":"2023-04-08T04:11:13.895Z","etag":null,"topics":[],"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/tabalt.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}},"created_at":"2014-10-10T11:32:52.000Z","updated_at":"2021-12-10T01:36:04.000Z","dependencies_parsed_at":"2022-08-17T18:40:54.563Z","dependency_job_id":null,"html_url":"https://github.com/tabalt/access-log-analysis","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/tabalt/access-log-analysis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabalt%2Faccess-log-analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabalt%2Faccess-log-analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabalt%2Faccess-log-analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabalt%2Faccess-log-analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tabalt","download_url":"https://codeload.github.com/tabalt/access-log-analysis/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabalt%2Faccess-log-analysis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28199989,"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","status":"online","status_checked_at":"2026-01-04T02:00:06.065Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2026-01-04T08:01:45.318Z","updated_at":"2026-01-04T08:02:32.087Z","avatar_url":"https://github.com/tabalt.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"access log analysis\n==================\n\n分析访问日志，可通过终端显示或邮件发送分析报告。\n\n### 一、下载\n\n* 下载release版\n\n\t[https://github.com/tabalt/access-log-analysis/releases](https://github.com/tabalt/access-log-analysis/releases)\n\n* 下载最新版本\n\n\t[https://github.com/tabalt/access-log-analysis/archive/master.zip](https://github.com/tabalt/access-log-analysis/archive/master.zip)\n\n\n### 二、配置\n\n* 创建配置文件\n\n\t\tcd ~/access-log-analysis\n\t\tcp conf.expmple conf.sh\n\t\tvim conf.sh\n\n* 修改配置\n\n\t* 设置日志文件路径\n\n\t\t\tlog_path=/usr/local/nginx/logs/archive\n\n\t* 设置接收报告邮箱\n\t\t\n\t\t\treport_email=\"\"\n\n\t* 日志文件名的后缀，如前一天的日期后缀：\n\t\t\n\t\t\tlog_file_suffix=`date -d \"yesterday\" +%Y%m%d`\n\t\t\n\t* 设置要分析的域名及日志文件\n\n\t\t\tlog_config=\"\n\t\t\twww.abc.com|$log_path/www_abc_com_access.log-$log_file_suffix\n\t\t\tapi.abc.com|$log_path/api_abc_com_access.log-$log_file_suffix\n\t\t\t\"\n\n### 三、使用\n\n* 在终输出分析结果\n\n\t\tsh run.sh\n\n* 通过邮件发送分析结果\n\n\t\tsh run.sh email\n\n* crontab 中定时执行\n\n\t每天11点发送分析报告：\n\n\t\t0 11 * * *  cd /home/tabalt/access-log-analysis; /bin/bash run.sh email \u003e /dev/null 2\u003e\u00261\n\n\n### 四、报表内容\n\n\n* 目前报表中会包含如下内容：\n\n\t* 报表域名、日志文件、时间等\n\t* 概况\n\t* 访问ip前N名\n\t* 被访问的url前N名\n\t* 来源页面前N名\n\t* 404页面前N名\n\t* 蜘蛛统计\n\t* 搜索引擎来源统计\n\n* 下面是终端下输出的报表形式：\n\n\t\t┌────────────────────────────────────────────\n\t\t│ 报表域名:\twww.abc.com\n\t\t│ 日志文件:\t/usr/local/nginx/logs/archive/www_abc_com_access.log-20141029\n\t\t│ 创建时间:\t2014-10-30 11:38\n\t\t├────────────────────────────────────────────\n\t\t│\n\t\t│　+ 概况 +\n\t\t│　────────────\n\t\t│\n\t\t│　　总访问量:\t1513\n\t\t│　　　总带宽:\t69M\n\t\t│　　独立访客:\t697\n\t\t│\n\t\t│\n\t\t│　+ 访问IP统计 +\n\t\t│　────────────\n\t\t│\n\t\t│\t\t19 123.151.136.151\n\t\t│\t\t18 220.170.90.112\n\t\t│\t\t16 49.4.178.31\n\t\t│\n\t\t│\n\t\t│　+ 访问url统计 +\n\t\t│　────────────\n\t\t│\n\t\t│\t\t...\n\t\t│\t\n\t\t│\n\t\t│　+ 来源页面统计 +\n\t\t│　────────────\n\t\t│\n\t\t│\t\t...\n\t\t│\t\n\t\t│\n\t\t│　+ 404统计 +\n\t\t│　────────────\n\t\t│\n\t\t│\t\t...\n\t\t│\t\n\t\t│\n\t\t│　+ 蜘蛛统计 +\n\t\t│　────────────\n\t\t│\n\t\t│\t\t...\n\t\t│\t\n\t\t│\n\t\t│　+ 搜索引擎来源统计 +\n\t\t│　────────────\n\t\t│\n\t\t│\t\t...\n\t\t│\t\n\t\t└────────────────────────────────────────────\n\n\t\t\n\t\t\n\n\t\n\n\t\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftabalt%2Faccess-log-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftabalt%2Faccess-log-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftabalt%2Faccess-log-analysis/lists"}