{"id":26234791,"url":"https://github.com/lizhichao/log2ck","last_synced_at":"2025-04-22T14:52:13.416Z","repository":{"id":62518187,"uuid":"306012646","full_name":"lizhichao/log2ck","owner":"lizhichao","description":"listening  log  file  written to clickhouse","archived":false,"fork":false,"pushed_at":"2021-06-10T11:44:48.000Z","size":10,"stargazers_count":35,"open_issues_count":0,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T16:11:14.109Z","etag":null,"topics":["clickhouse","log","logging"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/lizhichao.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":"2020-10-21T12:10:18.000Z","updated_at":"2024-03-22T02:44:25.000Z","dependencies_parsed_at":"2022-11-02T13:45:46.465Z","dependency_job_id":null,"html_url":"https://github.com/lizhichao/log2ck","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lizhichao%2Flog2ck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lizhichao%2Flog2ck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lizhichao%2Flog2ck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lizhichao%2Flog2ck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lizhichao","download_url":"https://codeload.github.com/lizhichao/log2ck/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250263524,"owners_count":21401894,"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":["clickhouse","log","logging"],"created_at":"2025-03-13T02:28:49.084Z","updated_at":"2025-04-22T14:52:13.396Z","avatar_url":"https://github.com/lizhichao.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nA simple log collector, Monitor files through `tail -F ` command, write to the Clickhouse.\nVery low occupancy of resources, It can process more than 100 thousand log information per second\n\n一个简单的日志收集器，占用极低的资源(比 `Logstash`，`Fluentd`，`Logtail`占用资源更少)，每秒可以轻松收集几十万以上的日志信息。\n\n## install\n\n`composer require lizhichao/log2ck`\n\n## example\n\n`tail -F apapche/access.log | php test.php`\n\n```php\n$db_conf             = [];\n$db_conf['host']     = 'tcp://192.168.23.129:9091';\n$db_conf['username'] = 'default';\n$db_conf['password'] = '123456';\n$db_conf['database'] = 'test1';\n\n$table       = 'web_log';\n$server_name = 'web1';\n\n$ck = new Log2Ck(\n    $db_conf, // \n    $table, // table \n    [\n    'host', 'ip', 'duration', \n    'create_time', 'method', 'url', 'path', 'code', 'size', \n    'refer', 'refer_host', 'user_agent', \n    'server_name'\n    ] //field name\n);\n$ck-\u003eregLogFn(function($row){\n    // 自己解析 $row\n    return $array; //和上面的字段对应\n})-\u003erun();\n\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flizhichao%2Flog2ck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flizhichao%2Flog2ck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flizhichao%2Flog2ck/lists"}