Skip to content

derricw/cwl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cwl

Simple CLI and TUI for browsing Cloudwatch logs in the terminal.

Aims to be as simple as possible but no simpler.

Made with VHS

Install

go install github.com/derricw/cwl@latest

Use

Basic

List log groups:

cwl groups

List streams for a group:

cwl streams /my/log/group

Write events from a stream to stdout:

cwl events arn:aws:logs:us-west-2:12345657890:log-group:/aws/batch/job:log-stream:my_batch_job_12345

Use a specific AWS profile (otherwise uses default credential chain):

cwl -p testProfile groups

Query a log group using cloudwatch query language:

cwl query /my/log/group -q "fields @timestamp, @message | sort @timestamp desc | limit 5"

Omit the arg to query all log groups:

cwl query -q "fields @timestamp, @message | sort @timestamp desc | limit 5"

Using in a pipeline

Each command can read input from stdin, so you can compose with other tools like fzf or grep:

cwl streams /aws/batch/job | fzf | cwl events

Start searching many log streams for a keyword and dump to file:

cwl streams /aws/batch/job | cwl events | grep "ERROR" > errors.log

TUI

Use with no arguments to start a TUI:

cwl

About

CLI for browsing Cloudwatch Logs

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages