Code Monkey home page Code Monkey logo

aws-cdk-lambda-logs-client's Introduction

AWS CDK Lambda Logs Client

Simpler Cloudwatch logs access for AWS CDK stacks.

Using AWS CDK to manage Lambda means your Lambda instance continually changes, and so does the log group you need to watch. This script wraps the AWS client to look up (by prefix) the log group with the most recent logging activity, while still supporting reasonable search, filter and time-window operations.

This script is not packaged as a library, because your CDK setup will affect the formatting of the prefix used for lookup. The current format is appropriate for my stack.

Usage

  • Basic

  • Watch

    # Watch all log events from most recently active log group,
    # for production environment that matches prefix thingservice
    ./log2 watch prod thingservice
    
    # Same as above, but filter for "error"
    ./log2 watch prod thingservice --filter error
  • Get

    # Get all log events from most recently active log group,
    # for production environment that matches prefix thingservice
    # over the last 2 hours
    ./log2 get prod thingservice --start -2h
    
    # Same as above, but filter for "error"
    ./log2 get prod thingservice --start -2h --filter error
    
    # Same as above, but instead, filter for "bobby", to find all events for [email protected]
    ./log2 get prod thingservice --start -2h --filter bobby
    
    # Same as above, but instead, filter for "bobby" and strip out all lines with "frank"
    ./log2 get prod thingservice --start -2h --filter "bobby -frank"
    
    # Same as above, but get activity from 2022-03-20 until 2022-03-23 
    ./log2 get prod thingservice --start 2022-03-20 --stop 2022-03-23 --filter error

aws-cdk-lambda-logs-client's People

Stargazers

 avatar

Watchers

 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.