{"id":26719037,"url":"https://github.com/psenger/cloudwatchlogs-query-example","last_synced_at":"2026-05-07T01:08:25.032Z","repository":{"id":37184185,"uuid":"203891908","full_name":"psenger/cloudwatchlogs-query-example","owner":"psenger","description":"A very simple example of cloudwatchlogs query","archived":false,"fork":false,"pushed_at":"2023-05-06T14:40:45.000Z","size":53,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T17:51:59.053Z","etag":null,"topics":["aws","cloudwatch","cloudwatch-logs","cloudwatchlogs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/psenger.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":"2019-08-23T00:06:31.000Z","updated_at":"2022-06-17T00:56:42.000Z","dependencies_parsed_at":"2025-03-27T17:51:16.345Z","dependency_job_id":"8dbacbfc-e9ae-4469-b916-ed3ab44fad8b","html_url":"https://github.com/psenger/cloudwatchlogs-query-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/psenger/cloudwatchlogs-query-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psenger%2Fcloudwatchlogs-query-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psenger%2Fcloudwatchlogs-query-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psenger%2Fcloudwatchlogs-query-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psenger%2Fcloudwatchlogs-query-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/psenger","download_url":"https://codeload.github.com/psenger/cloudwatchlogs-query-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psenger%2Fcloudwatchlogs-query-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268388537,"owners_count":24242590,"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-02T02:00:12.353Z","response_time":74,"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","cloudwatch","cloudwatch-logs","cloudwatchlogs"],"created_at":"2025-03-27T17:51:11.069Z","updated_at":"2026-05-07T01:08:19.996Z","avatar_url":"https://github.com/psenger.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cloudwatchlogs-query-example\n\nA very simple example of cloud watch logs query from NodeJS as a client.\n\n## Variables\n\nYou can use a `.env` for or environment variables.\n\n| Parameter              \t| Type                        \t| Purpose                                                                                                                                 \t|\n|------------------------\t|-----------------------------\t|-----------------------------------------------------------------------------------------------------------------------------------------\t|\n| `AWS_REGION`              | STRING (OPTIONAL)             | The AWS Region Defaults to ap-southeast-2                                                                                                 |\n| `AWS_PROFILE`          \t| STRING                      \t| The AWS Named Profile to use see [AWS Named Profile](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html)      \t|\n| `TIMEZONE`             \t| TIME ZONE DB NAME           \t| A full list of all DB Names can be found [List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) \t|\n| `START_DATE`           \t| ISO 8601 DATE               \t| YYYY-MM-DD format start date                                                                                                            \t|\n| `HOURS_RANGE`          \t| VALID JSON ARRAY OF NUMBERS \t| A valid JSON array of consecutive numbers of which represent the 24 hour period to scan. Eg `[20,21]` would be 9pm and 10pm               |\n| `CLOUDWATCH_LOG_GROUP` \t| STRING                      \t| The AWS Cloud Watch Log Group Name                                                                                                      \t|\n| `QUERY_STRING`            | STRING (OPTIONAL)             | The query string to send Cloud watch, the default is mentioned below                                 |\n\n## Default Cloud Watch Query\n\nThe default query is:\n\n```\nFIELDS @timestamp, @message\n| sort @timestamp desc\n```\nAs long as timestamp is first, it should work.\n\nYou could even do something like this...But have not tested either the of the following\n```\nFIELDS @timestamp, @message\n| filter @message like /requestid/\n| sort @timestamp desc\n```\nor\n```\nfilter @message like /Rate exceeded/\n| stats count(*) as exceptionCount by bin(1h)\n| sort exceptionCount desc\n```\n\nfini\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsenger%2Fcloudwatchlogs-query-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpsenger%2Fcloudwatchlogs-query-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsenger%2Fcloudwatchlogs-query-example/lists"}