{"id":22201766,"url":"https://github.com/claygregory/node-cloudfront-log-parser","last_synced_at":"2025-10-16T22:21:10.741Z","repository":{"id":51958520,"uuid":"82058906","full_name":"claygregory/node-cloudfront-log-parser","owner":"claygregory","description":"Parser for CloudFront web and RTMP access logs","archived":false,"fork":false,"pushed_at":"2022-12-30T19:20:58.000Z","size":238,"stargazers_count":20,"open_issues_count":3,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-17T13:06:22.967Z","etag":null,"topics":["access-logs","cloudfront","log-parser"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/claygregory.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-15T12:34:00.000Z","updated_at":"2024-04-05T20:16:52.000Z","dependencies_parsed_at":"2023-01-31T14:15:19.926Z","dependency_job_id":null,"html_url":"https://github.com/claygregory/node-cloudfront-log-parser","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/claygregory/node-cloudfront-log-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claygregory%2Fnode-cloudfront-log-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claygregory%2Fnode-cloudfront-log-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claygregory%2Fnode-cloudfront-log-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claygregory%2Fnode-cloudfront-log-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/claygregory","download_url":"https://codeload.github.com/claygregory/node-cloudfront-log-parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claygregory%2Fnode-cloudfront-log-parser/sbom","scorecard":{"id":285637,"data":{"date":"2025-08-11","repo":{"name":"github.com/claygregory/node-cloudfront-log-parser","commit":"727636b1472e72157d72cb901aff2f17a192563f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 1/23 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 6 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"21 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T17:10:14.493Z","repository_id":51958520,"created_at":"2025-08-17T17:10:14.493Z","updated_at":"2025-08-17T17:10:14.493Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279169227,"owners_count":26118401,"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":"2025-10-16T02:00:06.019Z","response_time":53,"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":["access-logs","cloudfront","log-parser"],"created_at":"2024-12-02T16:10:24.018Z","updated_at":"2025-10-16T22:21:10.702Z","avatar_url":"https://github.com/claygregory.png","language":"JavaScript","readme":"\n# CloudFront Access Log Parser\n\nThis is a log parser for Cloudfront Web Distribution and RTMP Distribution access logs. It can be called directly or with the Node.js Stream API.\n\n[![Build Status](https://travis-ci.org/claygregory/node-cloudfront-log-parser.svg?branch=master)](https://travis-ci.org/claygregory/node-cloudfront-log-parser)\n[![Coverage Status](https://coveralls.io/repos/github/claygregory/node-cloudfront-log-parser/badge.svg?branch=master)](https://coveralls.io/github/claygregory/node-cloudfront-log-parser?branch=master)\n\n## Installation\n\n```bash\nnpm install --save cloudfront-log-parser\n```\n\n## Usage Examples\n\n### Synchronous API\nGiven a string or Buffer of a log file, the `parse` function can be called directly, returning an array of parsed log entries.\n```javascript\nconst CloudFrontParser = require('cloudfront-log-parser');\nconst accesses = CloudFrontParser.parse('\u003ccontents of log file\u003e', { format: 'web' });\n//accesses = array of objects, see below for format\n```\n\n### Callback API\nIf `parse` is provided with a callback function, it will be called with an array of parsed entries as the result.\n```javascript\nconst CloudFrontParser = require('cloudfront-log-parser');\nCloudFrontParser.parse('\u003ccontents of log file\u003e', { format: 'web' }, function (err, accesses) {\n  //accesses = array of objects, see below for format\n});\n```\n\n### Node.js Stream API\n\nThe parser also implements `stream.Transform` for use in Node.js Streams.\n\n```javascript\nconst CloudFrontParser = require('cloudfront-log-parser');\nconst fs = require('fs');\nconst zlib = require('zlib');\n\nconst parser = new CloudFrontParser({ format: 'web' });\nparser.on('readable', function () {\n  let access;\n  while (access = parser.read()) {\n    //access = parsed entry object\n  }\n});\n\nfs.createReadStream('./somelogfile.gz')\n  .pipe(zlib.createGunzip())\n  .pipe(parser);\n```\n\n### Options\n\nOnly two configuration options are currently in effect: format and version. The parser defaults to `web` to handle the web distribution file format. If logs are streaming from CloudFront to Kinesis the format should be set to `kinesis` as the column headers and order changes. If logs are from an RTMP distribution, this value should be set to `rtmp`. Currently all CloudFront logs are on version 1.0; should future versions appear, the `version` option will serve as an override.\n\n```javascript\nconst options = {\n  format: 'web|rtmp|kinesis',\n  version: '1.0'\n};\n```\n\n## Result Object\n\n### Web Distribution Format\n\n```javascript\n{ 'date': '2017-02-09',\n  'time': '17:50:17',\n  'x-edge-location': 'MUC51',\n  'sc-bytes': '2797',\n  'c-ip': '192.168.0.123',\n  'cs-method': 'GET',\n  'cs-host': 'yourdistribution.cloudfront.net',\n  'cs-uri-stem': '/',\n  'sc-status': '200',\n  'cs-referer': '-',\n  'cs-user-agent': 'Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)',\n  'cs-uri-query': '-',\n  'cs-cookie': '-',\n  'x-edge-result-type': 'Hit',\n  'x-edge-request-id': 'sjXpb8nMq_1ewovZ6nrojpvxIETPbo7EhF2RNtPZ_zfd0MtOW6pjlg==',\n  'x-host-header': 'example.com',\n  'cs-protocol': 'https',\n  'cs-bytes': '148',\n  'time-taken': '0.002',\n  'x-forwarded-for': '-',\n  'ssl-protocol': 'TLSv1.2',\n  'ssl-cipher': 'ECDHE-RSA-AES128-GCM-SHA256',\n  'x-edge-response-result-type': 'Hit',\n  'cs-protocol-version': 'HTTP/1.1' }\n```\n\n\n### CloudFront to Kinesis Distribution Format\n```javascript\n{ 'timestamp': '1607374321.541',\n  'c-ip': '127.0.0.1',\n  'time-to-first-byte': '0.042',\n  'sc-status': '200',\n  'sc-bytes': '485',\n  'cs-method': 'GET',\n  'cs-protocol': 'http',\n  'cs-host': 'test.cloudfront.net',\n  'cs-uri-stem': '/i?hello=1',\n  'cs-bytes': '745',\n  'x-edge-location': 'EWR52-C4',\n  'x-edge-request-id': '6PfZe0cc_AjXUjFuGnL9pGOmFdUx8xR8ZU8nr44JYJWi-DaeJjcxkw==',\n  'x-host-header': 'test.cloudfront.net',\n  'time-taken': '0.042',\n  'cs-protocol-version': 'HTTP/1.1',\n  'c-ip-version': 'IPv4',\n  'cs-user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:83.0) Gecko/20100101 Firefox/83.0',\n  'cs-referer': 'http://localhost:5000/page-2',\n  'cs-cookie': '-',\n  'query-params': 'hello=1607374321563',\n  'x-edge-response-result-type': 'Miss',\n  'x-forwarded-for': '-',\n  'ssl-protocol': '-',\n  'ssl-cipher': '-',\n  'x-edge-result-type': 'Miss',\n  'fle-encrypted-fields': '-',\n  'fle-status': '-',\n  'sc-content-type': 'image/gif',\n  'sc-content-len': '35',\n  'sc-range-start': '-',\n  'sc-range-end': '-',\n  'c-port': '49323',\n  'x-edge-detailed-result-type': 'Miss',\n  'c-country': 'US',\n  'cs-accept-encoding': 'gzip, deflate',\n  'cs-accept': 'image/webp,*/*',\n  'cache-behavior-path-pattern': '*',\n  'cs-headers': 'Host:test.cloudfront.net\\n...',\n  'cs-headers-count': '8'\n}\n```\n\n### RTMP Distribution Format\n\n```javascript\n{ 'date': '2010-03-12',\n  'time': '23:56:21',\n  'x-edge-location': 'SEA4',\n  'c-ip': '192.0.2.199',\n  'x-event': 'stop',\n  'sc-bytes': '429822014',\n  'x-cf-status': 'OK',\n  'x-cf-client-id': 'bfd8a98bed0840d2b871b7f6adf9908f',\n  'cs-uri-stem': 'rtmp://yourdistribution.cloudfront.net/cfx/st',\n  'cs-uri-query': 'key=value',\n  'c-referrer': 'http://player.example.com/player.swf',\n  'x-page-url': 'http://www.example.com/video',\n  'c-user-agent': 'LNX 10,0,32,18',\n  'x-sname': '-',\n  'x-sname-query': '-',\n  'x-file-ext': '-',\n  'x-sid': '-' }\n```\n\n## License\n\nSee the included [LICENSE](LICENSE.md) for rights and limitations under the terms of the MIT license.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclaygregory%2Fnode-cloudfront-log-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclaygregory%2Fnode-cloudfront-log-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclaygregory%2Fnode-cloudfront-log-parser/lists"}