{"id":22073033,"url":"https://github.com/linlindu/logcollector","last_synced_at":"2026-04-17T08:31:09.256Z","repository":{"id":203462291,"uuid":"194605443","full_name":"LinlinDu/logCollector","owner":"LinlinDu","description":"一个日志搜集app，用于集群系统产生的日志","archived":false,"fork":false,"pushed_at":"2019-07-01T11:50:41.000Z","size":18,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-06T12:59:20.784Z","etag":null,"topics":["elasticsearch","go","kafka","kibana","log-collector","tail"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LinlinDu.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}},"created_at":"2019-07-01T05:28:30.000Z","updated_at":"2020-11-04T03:09:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"dc13e138-6d6f-481a-b6f4-ad1c7b478115","html_url":"https://github.com/LinlinDu/logCollector","commit_stats":null,"previous_names":["linlindu/logcollector"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LinlinDu/logCollector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinlinDu%2FlogCollector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinlinDu%2FlogCollector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinlinDu%2FlogCollector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinlinDu%2FlogCollector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LinlinDu","download_url":"https://codeload.github.com/LinlinDu/logCollector/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinlinDu%2FlogCollector/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31921742,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"online","status_checked_at":"2026-04-17T02:00:06.879Z","response_time":62,"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":["elasticsearch","go","kafka","kibana","log-collector","tail"],"created_at":"2024-11-30T21:16:34.169Z","updated_at":"2026-04-17T08:31:09.235Z","avatar_url":"https://github.com/LinlinDu.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# logCollector\n\n## 介绍\n背景：日志文件是几乎任何系统必备的一项，当某个集群机器比较少时，查看日志不是难事，但是机器比较多时，需要有一套日志系统来方便管理。\n\n目标：把集群机器上的日志实时收集，统一储存到中心系统，对这些系统建立索引，通过搜索即可找到对应日志，通过提供界面有好的web界面，通过web即可完成日志搜索。日志准实时搜集，延时控制在分钟级别。\n\n整个项目分两个独立app:logAgent和logCollector。他们之间通过kafka传递数据。\n## 系统架构\n![avatar](https://github.com/LinlinDu/myMarkdownPhotos/blob/master/photos/logcollect2.jpg)\n## 安装\n```\ngo get github.com/LinlinDu/logCollector\n```\n## 如何使用\n集群中安装kafka，选择一台机器用于管理日志，安装elasticsearch，kibana。 \u003c/br\u003e\n在conf文件夹中填写相应配置，在集群中需要收集日志的机器中使用logAgent，在管理日志的机器中使用logCollector。\n\n## 运行案例\napp启动后，首先会等待日志文件在你设定的位置出现，发现文件后然后开始逐条搜集日志。\u003c/br\u003e\n在dubug模式下输出如下\n```\n2019/07/01 13:09:53 Waiting for logs/20190701.log to appear...\n2019/07/01 13:09:53.698 [I]  Log Agent start running...\n2019/07/01 13:15:05.402 [D]  topic: [log] pid: [6], offset: [50]\n2019/07/01 13:15:05.409 [D]  topic: [log] pid: [3], offset: [50]\n2019/07/01 13:16:47.192 [D]  topic: [log] pid: [7], offset: [49]\n2019/07/01 13:17:14.159 [D]  topic: [log] pid: [1], offset: [59]\n2019/07/01 13:17:31.252 [D]  topic: [log] pid: [3], offset: [51]\n2019/07/01 13:17:33.021 [D]  topic: [log] pid: [7], offset: [50]\n```\n访问http://127.0.0.1:5601 ，打开kibana，可看到搜集到的日志\n![avatar](https://github.com/LinlinDu/myMarkdownPhotos/blob/master/photos/logcollect.jpg)\n## 使用\n+ kafka\n+ zookeeper\n+ tail\n+ elasticsearch\n+ kibana\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinlindu%2Flogcollector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinlindu%2Flogcollector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinlindu%2Flogcollector/lists"}