Git Product home page Git Product logo

go-awslogs's Introduction

go-awslogs

Go Report Card Github Workflow: Go

Introduction

Inspired by https://github.com/jorgebastida/awslogs.

go-awslogs is a command line utility for easier access of AWS CloudWatch logs.

TL;DR:

# Show all log groups
go-awslogs groups

# Show all log streams of a group
go-awslogs streams <group_name>

# Watch log stream
go-awslogs get <group_name> --watch

# Show help
go-awslogs help

Usage

Get Log Groups

go-awslogs groups

# Filter the result with group name prefix
go-awslogs groups --prefix <prefix>

Get Log Streams

go-awslogs streams <group_name>

Get Log Events

go-awslogs get <group_name> [stream_name1 [, stream_name2 [,...]]]

Additional arguments:

--watch, -w: Watch the log streams (like tail -f)

--start, -s: Filter the log events by starting timestamp (Show log events after the timestamp)

--end, -e: Filter the log events by end timestamp (Show log events before the timestamp)

--stream-name, -N: Print the stream name as prefix of each line

Time Parsing

For the timestamp arguments like --start and --end, go-awslogs accepts 3 forms of time string:

Relative Time: 5min ago, 1.5hours ago, etc. (ago can be omitted)

RFC3339: 2020-07-23T15:23:35Z or 2020-07-23T08:23:35-07:00

Human: 01/02/2006 15:04:05 -07:00

AWS Profile

go-awslogs internally uses aws-sdk-go-v2. It loads the default AWS profile without any setting.

A different AWS profile can be used by setting an environment variable:

AWS_PROFILE=my_other_profile go-awslogs groups

Also, you can set environment variables directly for AWS_SECRET_ACCESS_KEY, AWS_ACCESS_KEY and AWS_REGION etc.

Build

Mac

Clone this repository and run ./build script. It will compile the project and generate binaries for both Mac and Linux.

More Information

go-awslogs's People

Contributors

dzhg avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.