{"id":23107082,"url":"https://github.com/four43/aws-cloudwatch-log-clean","last_synced_at":"2025-08-16T17:31:17.974Z","repository":{"id":52218970,"uuid":"117382755","full_name":"four43/aws-cloudwatch-log-clean","owner":"four43","description":"Some simple scripts for cleaning AWS CloudWatch Logs. Useful for cleaning up after AWS Lambda Functions.","archived":false,"fork":false,"pushed_at":"2021-05-04T19:29:58.000Z","size":11,"stargazers_count":53,"open_issues_count":0,"forks_count":15,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-04T15:11:52.569Z","etag":null,"topics":["aws","aws-cloudwatch","aws-lambda"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/four43.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":"2018-01-13T22:16:57.000Z","updated_at":"2024-06-17T17:32:56.000Z","dependencies_parsed_at":"2022-08-23T19:00:31.585Z","dependency_job_id":null,"html_url":"https://github.com/four43/aws-cloudwatch-log-clean","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/four43/aws-cloudwatch-log-clean","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/four43%2Faws-cloudwatch-log-clean","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/four43%2Faws-cloudwatch-log-clean/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/four43%2Faws-cloudwatch-log-clean/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/four43%2Faws-cloudwatch-log-clean/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/four43","download_url":"https://codeload.github.com/four43/aws-cloudwatch-log-clean/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/four43%2Faws-cloudwatch-log-clean/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270746129,"owners_count":24638288,"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-08-16T02:00:11.002Z","response_time":91,"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":["aws","aws-cloudwatch","aws-lambda"],"created_at":"2024-12-17T01:12:13.214Z","updated_at":"2025-08-16T17:31:17.651Z","avatar_url":"https://github.com/four43.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS CloudWatch Log Clean\n\nSome simple scripts for cleaning AWS CloudWatch Logs. Useful for cleaning up after AWS Lambda Functions. AWS doesn't seem to have nice rotation and cleanup for these. Leading to extremely degraded performance for CloudWatch metric \"tailing\".\n\n**Notice:** These are destructive operations that will result in lost data if used incorrectly. I'm not responsible for any of your data that gets lost. I have personally tested these scripts and have used them as part of a maintenance procedure, but I don't guarantee they will work perfectly for you. Look over the scripts before running they, they're hopefully pretty straight forward.\n\n## Installation\n\nEnsure you have boto3: `pip install -y boto3`\n\nThese are just little helpers scripts and it isn't on Pypi or anything, just grab the zip:\n\n```bash\nwget -O aws-loudwatch-log-clean.zip https://github.com/four43/aws-cloudwatch-log-clean/archive/master.zip \\\n  \u0026\u0026 unzip ./aws-loudwatch-log-clean.zip\n```\n\nOr copy/paste the raw files into your own `.py` file. They don't depend on anything except `boto3`\n\n## Usage\n\n### nuke_log_group.py\n\nThis delete a log group and replace it with a new one with the same settings. This essentially clears all log streams from the log group. Usage:\n\n```bash\n./nuke_log_group.py [log-stream-prefix] --dry-run\n```\n\nCheck that everything looks good, then:\n\n```bash\n./nuke_log_group.py [log-stream-prefix]\n```\n\n**Example:**\n\n```bash\n./nuke_log_group.py /aws/lambda/my-func\n```\n\n### sweep_log_streams.py\n\nThis will clean up old and empty log streams inside of a log group. Usage:\n\n```bash\n./sweep_log_streams.py [log-stream-prefix] --dry-run\n```\n\nCheck that everything looks good, then:\n\n```bash\n./sweep_log_streams.py [log-stream-prefix]\n```\n\n\nExample:\n\n```bash\n./sweep_log_streams.py /aws/lambda/my-func\n```\n\n## Contributing\n\nFeedback, issues, forks, and pull requests welcome! Thanks.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffour43%2Faws-cloudwatch-log-clean","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffour43%2Faws-cloudwatch-log-clean","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffour43%2Faws-cloudwatch-log-clean/lists"}