All Projects → lucagrulla → Cw

lucagrulla / Cw

Licence: apache-2.0
The best way to tail AWS CloudWatch Logs from your terminal

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects
bash
514 projects

Projects that are alternatives of or similar to Cw

Saw
Fast, multi-purpose tool for AWS CloudWatch Logs
Stars: ✭ 1,071 (+191.03%)
Mutual labels:  aws, cli, logs, tail
Saws
A supercharged AWS command line interface (CLI).
Stars: ✭ 4,886 (+1227.72%)
Mutual labels:  aws, cli, terminal
Nord Dircolors
An arctic, north-bluish clean and elegant dircolors theme.
Stars: ✭ 328 (-10.87%)
Mutual labels:  cli, terminal, zsh
Caporal.js
A full-featured framework for building command line applications (cli) with node.js
Stars: ✭ 3,279 (+791.03%)
Mutual labels:  cli, terminal, zsh
Geo
🌎 A Bash utility for easy wan, lan, router, dns, mac address, and geolocation output, with clean stdout for piping
Stars: ✭ 225 (-38.86%)
Mutual labels:  cli, terminal, zsh
Httpie
As easy as /aitch-tee-tee-pie/ 🥧 Modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more. https://twitter.com/httpie
Stars: ✭ 53,052 (+14316.3%)
Mutual labels:  cli, terminal, devops
Terragrunt
Terragrunt is a thin wrapper for Terraform that provides extra tools for working with multiple Terraform modules.
Stars: ✭ 5,446 (+1379.89%)
Mutual labels:  aws, cli, devops
Bashhub Server
Private cloud shell history. Open source server for bashhub https://github.com/rcaloras/bashhub-client
Stars: ✭ 189 (-48.64%)
Mutual labels:  cli, terminal, zsh
Awless Templates
Repository of examples for awless templates (see https://github.com/wallix/awless)
Stars: ✭ 59 (-83.97%)
Mutual labels:  aws, cli, devops
Iamy
A cli tool for importing and exporting AWS IAM configuration to YAML files
Stars: ✭ 200 (-45.65%)
Mutual labels:  aws, cli, devops
Nord Xresources
An arctic, north-bluish clean and elegant Xresources color theme.
Stars: ✭ 210 (-42.93%)
Mutual labels:  cli, terminal, zsh
Nord Gnome Terminal
An arctic, north-bluish clean and elegant GNOME Terminal color theme.
Stars: ✭ 258 (-29.89%)
Mutual labels:  cli, terminal, zsh
Nord Terminal App
An arctic, north-bluish clean and elegant Terminal.app color theme.
Stars: ✭ 198 (-46.2%)
Mutual labels:  cli, terminal, zsh
Org Formation Cli
Better than landingzones!
Stars: ✭ 471 (+27.99%)
Mutual labels:  aws, cli, devops
Zoxide
A smarter cd command. Supports all major shells.
Stars: ✭ 4,422 (+1101.63%)
Mutual labels:  cli, terminal, zsh
Awless
A Mighty CLI for AWS
Stars: ✭ 4,821 (+1210.05%)
Mutual labels:  aws, cli, devops
Nord Termite
An arctic, north-bluish clean and elegant Termite color theme.
Stars: ✭ 104 (-71.74%)
Mutual labels:  cli, terminal, zsh
Nord Xfce Terminal
An arctic, north-bluish clean and elegant Xfce Terminal color theme.
Stars: ✭ 136 (-63.04%)
Mutual labels:  cli, terminal, zsh
Opscloud
运维管理平台(阿里云),自动同步阿里云配置信息,堡垒机(容器),批量运维,Kubernetes,Zabbix管理等功能
Stars: ✭ 788 (+114.13%)
Mutual labels:  aws, terminal, devops
Utern
Multi group and stream log tailing for AWS CloudWatch Logs.
Stars: ✭ 241 (-34.51%)
Mutual labels:  aws, devops, tail

cw

Release Software License Github All Releases CircleCI branch

cw - the best way to tail AWS CloudWatch Logs

The best way to tail AWS CloudWatch Logs from your terminal.

Author - Luca Grulla - https://www.lucagrulla.com

Features

  • No external dependencies
    • cw is a native executable targeting your OS. No pip, npm, rubygems.
  • Fast.
    • cw is written in golang and compiled against your architecture.
  • Flexible date and time parser.
    • Work with either Local timezone or UTC (default).
    • Flexible parsing.
      • Human friendly formats, i.e. 2d1h20m to indicate 2 days, 1 hour and 20 minutes ago.
      • a specific hour, i.e. 13:10 to indicate 13:10 of today.
      • a full timestamp 2018-10-20T8:53.
  • Multi log groups tailing
    • tail multiple log groups in parallel: cw tail my-auth-service my-web.
  • Powerful built-in grep (--grep) and grepv (--grepv).
  • Pipe operator supported
    • echo my-group | cw tail and cat groups.txt | cw tail.
  • Redirection operator >> supported
    • cw tail -f my-stream >> myfile.txt.
  • Coloured output
    • --no-color flag to disable if needed.
  • Flexible credentials control.
    • By default the AWS .aws/credentials and .aws/profile files are used. Overrides can be achieved with the --profile and --region flags.

Installation

Mac OSX

using Homebrew

brew tap lucagrulla/tap
brew install cw

Linux

using Linuxbrew

brew tap lucagrulla/tap
brew install cw

.deb/.rpm

Download the .deb or .rpm from the releases page and install with dpkg -i and rpm -i respectively.

using Snapcraft.io

Note: If you upgrade to 3.3.0 please note the new alias command.This is required to comply with snapcraft new release rules.

snap install cw-sh
sudo snap connect cw-sh:dot-aws-config-credentials
sudo snap alias cw-sh.cw cw

cw runs with strict confinement; the dot-aws-config-credentials interface connection is required to have access to .aws/config and .aws/credentials files

Get it from the Snap Store

On Windows

using Scoop.sh

scoop bucket add cw https://github.com/lucagrulla/cw-scoop-bucket.git
scoop install cw

Go tools

go get github.com/lucagrulla/cw

Commands and options

Global flags

  • --profile=profile-name Override the AWS profile used for connection.
  • --region=aws-region Override the target AWS region.
  • --no-color Disable coloured output.
  • --endpooint The target AWS endpoint url. By default cw will use the default aws endpoints.

Commands

  • cw ls list all the log groups/log streams within a group
    usage: cw ls <command> [<args> ...]
    
    Show an entity
    
    Flags:
        --help             Show context-sensitive help (also try --help-long and --help-man).
        --profile=PROFILE  The target AWS profile. By default cw will use the default profile defined in the .aws/credentials file.
        --region=REGION    The target AWS region.. By default cw will use the default region defined in the .aws/credentials file.
        --endpoint=ENDPOINT-URL The target AWS endpoint url. By default cw will use the default aws
                         endpoints.
    -c, --no-color         Disable coloured output.
        --version          Show application version.
    
    Subcommands:
    ls groups
        Show all groups.
    
    ls streams <group>
        Show all streams in a given log group.
    
  • cw tail tail a given log group/log stream
        usage: cw tail [<flags>] <groupName:logStreamPrefix...>...
    
        Tail log groups/streams.
    
        Flags:
            --help             Show context-sensitive help (also try --help-long and --help-man).
            --profile=PROFILE  The target AWS profile. By default cw will use the default profile defined in the .aws/credentials file.
            --region=REGION    The target AWS region. By default cw will use the default region defined in the .aws/credentials file.
            --no-color         Disable coloured output.
            --version          Show application version.
        -f, --follow           Don't stop when the end of streams is reached, but rather wait for additional data to be appended.
        -t, --timestamp        Print the event timestamp.
        -i, --event-id         Print the event Id.
        -s, --stream-name      Print the log stream name this event belongs to.
        -n, --group-name       Print the log log group name this event belongs to.
        -b, --start="2018-12-25T09:34:45"
                               The UTC start time. Passed as either date/time or human-friendly format. The human-friendly format accepts the number of days, hours and minutes prior to the present. Denote days with
                               'd', hours with 'h' and minutes with 'm' i.e. 80m, 4h30m, 2d4h. If just time is used (format: hh[:mm]) it is expanded to today at the given time. Full available date/time format:
                               2017-02-27[T09[:00[:00]].
        -e, --end=""           The UTC end time. Passed as either date/time or human-friendly format. The human-friendly format accepts the number of days, hours and minutes prior to the present. Denote days with
                               'd', hours with 'h' and minutes with 'm' i.e. 80m, 4h30m, 2d4h. If just time is used (format: hh[:mm]) it is expanded to today at the given time. Full available date/time format:
                               2017-02-27[T09[:00[:00]].
        -l, --local            Treat date and time in Local timezone.
        -r --retry             Keep trying to open a log group/log stream if it is inaccessible.
        -g, --grep=""          Pattern to filter logs by. See http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html for syntax.
        -v, --grepv=""         Equivalent of grep --invert-match. Invert match pattern to filter logs by.
    
        Args:
        <groupName:logStreamPrefix...>
            The log group and stream name, with group:prefix syntax.Stream name can be just the prefix. If no stream name is specified all stream names in the given group will be tailed.Multiple group/stream
            tuple can be passed. e.g. cw tail group1:prefix group2:prefix group3:prefix.     
    

Examples

  • list of the available log groups
    • cw ls groups
  • list of the log streams in a given log group
    • cw ls streams my-log-group
  • tail and follow given log groups/streams
    • cw tail -f my-log-group
    • cw tail -f my-log-group:my-log-stream-prefix
    • cw tail -f my-log-group:my-log-stream-prefix my-log-group2
    • cw tail -f my-log-group:my-log-stream-prefix -b2017-01-01T08:10:10 -e2017-01-01T08:05:00
    • cw tail -f my-log-group:my-log-stream-prefix -b7d to start from 7 days ago.
    • cw tail -f my-log-group:my-log-stream-prefix -b3h to start from 3 hours ago.
    • cw tail -f my-log-group:my-log-stream-prefix -b100m to start from 100 minutes ago.
    • cw tail -f my-log-group:my-log-stream-prefix -b2h30m to start from 2 hours and 30 minutes ago.
    • cw tail -f my-log-group -b9:00 -e9:01

Time and Dates

Time and dates are treated as UTC by default. Use the --local flag if you prefer to use Local zone.

AWS credentials and configuration

cw uses the default credentials profile (stored in ./aws/credentials) for authentication and shared config (.aws/config) for identifying the target AWS region. Both profile and region are overridable via the profile and region global flags.

AWS SSO

As today (May 2020) AWS Go SDK is not supporting AWS SSO correctly. The best approach is to use one of these tools while the SDK is updated: https://github.com/benkehoe/aws-sso-credential-process https://github.com/victorskl/yawsso

Miscellaneous

Use cw behind a proxy

Please use HTTP_PROXY environment variable as required by AWS cli: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-proxy.html

Breaking changes notes

Read here

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].