cw.js
is written by Typescript
and based on AWS SDK CloudWatchLogs and ECS.
It supports reading logs in a cluster mode which means you can read all tasks in a window and has also supported local cache for group names.
Installing the cw.js
as a global package.
$ npm i -g cw.js
$ cw --profile en --region us-east-1
cw --help
Usage: cw [Options]
Options:
-V, --version output the version number
-a, --access-key-id <type> specify aws access key id
-c, --cluster <type> ECS cluster numbers
-d, --debug output extra debugging
-g, --group-name <type> specify group name of cloud-watch service
-p, --profile <type> aws credential profile
-r, --region <type> specify aws region
-s, --secret-access-key <type> specify aws secret access key
-lc, --local-cache use local cache, if data are stored in local environment
-h, --help display help for command
Example:
$cw -a ${awsAccessKeyId} -s ${awsSecretAccessKey} -r ${awsRegion} -g ${groupName}
$cw -p ${awsCredentialProfile} -r ${awsRegion} -g ${groupName}
There is a thing you need to know which makes sure the credentials are stored to local configuration if you are going to use --profile
.