Giter Club home page Giter Club logo

fetch-cloudwatch-logs's Introduction

Intro

Fetching long codebuild output (or indeed any other cloudwatch logs) is painful, because you need to click 8,000 times with a long wait every time. Searching only shows the individual lines that match - rather than the surrounding output.

Additionally, the AWS CLI doesn't help much - because it doesn't automatically fetch all pages. So it needs to be wrapped in a script like https://gist.github.com/gholker/88639858d53ae3ccec7ddd306cd8ba22#file-download-aws-logs-sh

This simple ruby script will fetch all the logs for a given log group and log stream.

Installation

Use rbenv install or similar to install the correct version of Ruby.

Then, use bundle to install the aws-sdk-cloudwatchlogs gem.

Usage

You can then use a command like this to write the log to a file on your desktop.

bundle exec ./fetch-cloudwatch-logs.rb /aws/codebuild/my-log-group uuid-over-here > ~/Desktop/uuid-over-here.txt

If you use aws-vault you can use a command like this to run things in the right aws environment

aws-vault exec the-environment-name -- bundle exec ./fetch-cloudwatch-logs.rb /aws/codebuild/my-log-group uuid-over-here > ~/Desktop/uuid-over-here.txt

fetch-cloudwatch-logs's People

Contributors

oskarpearson avatar

Watchers

 avatar  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.