{"id":24081515,"url":"https://github.com/beh01der/docker-log-monit-service","last_synced_at":"2026-06-13T17:02:27.969Z","repository":{"id":69196533,"uuid":"58361928","full_name":"Beh01der/docker-log-monit-service","owner":"Beh01der","description":null,"archived":false,"fork":false,"pushed_at":"2016-05-10T09:12:49.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-27T00:41:41.520Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/Beh01der.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-09T08:45:02.000Z","updated_at":"2016-05-10T09:23:23.000Z","dependencies_parsed_at":"2023-04-03T21:34:21.669Z","dependency_job_id":null,"html_url":"https://github.com/Beh01der/docker-log-monit-service","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Beh01der/docker-log-monit-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Beh01der%2Fdocker-log-monit-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Beh01der%2Fdocker-log-monit-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Beh01der%2Fdocker-log-monit-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Beh01der%2Fdocker-log-monit-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Beh01der","download_url":"https://codeload.github.com/Beh01der/docker-log-monit-service/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Beh01der%2Fdocker-log-monit-service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34292326,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","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":[],"created_at":"2025-01-09T23:17:04.473Z","updated_at":"2026-06-13T17:02:27.964Z","avatar_url":"https://github.com/Beh01der.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# docker-log-monit-service\nSimple log monitor / metrics collector service for docker containers with StatsD integration.\nIt listens for logs from docker containers then generates metrics based on supplied rules. Metrics then sent to StatsD.\n\n**docker-log-monit-service** uses: \n* [node-docker-log-monitor](https://www.npmjs.com/package/node-docker-log-monitor) for docker log monitoring\n* [node-grok](https://www.npmjs.com/package/node-grok) for log parsing \n* [metrix-js](https://www.npmjs.com/package/metrix-js) for metrics generation\n* [statsd-client](https://www.npmjs.com/package/statsd-client) for communication with StatsD\n\n## Run\nOn host: `node src/service.js`\nIn Docker container: `docker run -d -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/containers:/var/lib/docker/containers:ro beh01der/docker-log-monit-service`\n\n## Configuration parameters\n**docker-log-monit-service** is configured through environment variables:\n* STATSD_HOST - StatsD host name ('localhost')\n* STATSD_PORT - StatsD port number (8125)\n* LOG_PATTERN - log pattern in **grok** format (`%{IP:client} \\\\[%{TIMESTAMP_ISO8601:timestamp}\\\\] \"%{WORD:method} %{URIHOST:site}%{URIPATHPARAM:url}\" %{INT:code} %{INT:request} %{INT:response} - %{NUMBER:took} \\\\[%{DATA:cache}\\\\] \"%{DATA:mtag}\" \"%{DATA:agent}\"`)\n* SELECTOR_LABEL - Docker container label to be used to mark containers that should be monitored ('monitor-logs') \n* METRICS - metric definitions for [metrix-js](https://www.npmjs.com/package/metrix-js)\n```\n[\n    { field: 'code', matcher: 'regex', match: '(\\\\d)\\\\d\\\\d', metric: 'router.hit.$100' },\n    { field: 'code', matcher: 'regex', match: '\\\\d{3}', metric: 'router.hit' },\n    { field: 'url', matcher: 'substring', match: 'api/note', metric: 'api.note.hit' },\n    { field: 'url', matcher: 'substring', match: 'api/note', metric: 'api.hit' },\n    { field: 'url', matcher: 'substring', match: 'api/policy', metric: 'api.hit' }\n]\n```\n\n## License \n**ISC License (ISC)**\n\nCopyright (c) 2015, Andrey Chausenko \u003candrey.chausenko@gmail.com\u003e\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeh01der%2Fdocker-log-monit-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeh01der%2Fdocker-log-monit-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeh01der%2Fdocker-log-monit-service/lists"}