cloudwatch-logs-search

This is sample logic that filters and retrieves logs from Amazon CloudWatch.

Usage no npm install needed!

<script type="module">
  import cloudwatchLogsSearch from 'https://cdn.skypack.dev/cloudwatch-logs-search';
</script>

README

cloudwatch-logs-search

This is sample logic that filters and retrieves logs from Amazon CloudWatch.

Reference

Changelog

See CHANGELOG.md.

Getting Started

Install package.

npm i cloudwatch-logs-search;

Install dependent packages.

cd cloudwatch-logs-search;
npm i;

Add your Amazon CloudWatch Logs credentials to your environment variables.

.env:

NODE_ENV=development
AWS_CLOUD_WATCH_LOGS_REGION=ap-northeast-1
AWS_CLOUD_WATCH_LOGS_ACCESS_KEY=****
AWS_CLOUD_WATCH_LOGS_SECRET_KEY=********

Search logs.

The log group name is an exact match search and the log stream name is an fuzzy search.

node search.js 'Log group name' 'Log stream name';

Usage

How to use search.js.

Gets all logs from the stream that contains the specified log stream name..

node search.js 'Log group name' 'Log stream name';

Gets the log that matches the keyword from the stream that contains the specified log stream name..

node search.js 'Log group name' 'Log stream name' 'keyword';

License

MIT licensed