{"id":19030506,"url":"https://github.com/sofish/log2mongo","last_synced_at":"2025-04-23T16:06:53.279Z","repository":{"id":143449400,"uuid":"46216469","full_name":"sofish/log2mongo","owner":"sofish","description":"automatic log to mongodb","archived":false,"fork":false,"pushed_at":"2015-12-04T07:23:52.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-23T16:06:47.068Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sofish.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}},"created_at":"2015-11-15T12:23:29.000Z","updated_at":"2018-01-23T00:49:12.000Z","dependencies_parsed_at":"2023-03-18T14:17:01.426Z","dependency_job_id":null,"html_url":"https://github.com/sofish/log2mongo","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofish%2Flog2mongo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofish%2Flog2mongo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofish%2Flog2mongo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofish%2Flog2mongo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sofish","download_url":"https://codeload.github.com/sofish/log2mongo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250468272,"owners_count":21435452,"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-11-08T21:18:19.696Z","updated_at":"2025-04-23T16:06:53.259Z","avatar_url":"https://github.com/sofish.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![build status](https://travis-ci.org/sofish/log2mongo.svg?branch=master) \n\n**注意：**Travis-ci 的执行 path 好奇怪，大家用拉下来执行 \\`npm test\\` 吧\n\n# log2mongo\n\nimport JSON to mongodb, associate with [sofish/log2json](https://github.com/sofish/log2json) to manage nginx logs.\n\n```php\n$ npm install log2mongo -g\n```\n\n## Usage\n\nIt's a command line tool and should install with the `-g` flag.\n\n```php\n$ log2mongo config.js\n```\n\nThe `config.js` should be a node module like this:\n\n```js\nmodule.exports = {\n  \"db\": \"db-name\",\n  \"host\": \"127.0.0.1:27017\",\n  \"collection\": \"collection\",       // {function|string} collection to insert, or a function returns a string\n\n  \"dir\": \"dir/contains/logs\",       // where to find logs\n  \"skip\": skip(filename)            // {function} [optional] a function return Boolean, when True, file ignored\n  \"separator\": \"•-•\",               // separator of your (nginx/apache/whatever) log fields\n  \"map\": [],                        // map with log fields that create by `split(separator)`\n\n  \"username\": \"sofish\",             // [optional] db username\n  \"password\": \"***\"                 // [optional] db password\n}\n```\n\n## Test\n\nSimply run `npm test` to see what happens.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsofish%2Flog2mongo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsofish%2Flog2mongo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsofish%2Flog2mongo/lists"}