GithubHelp home page GithubHelp logo

le-aws-cloudwatch's Introduction

le-aws-cloudwatch

AWS Lambda function for sending AWS CloudWatch logs to Logentries in near real-time for processing and analysing
Example use cases:

Obtain log token(s)

  1. Log in to your Logentries account
  2. Add a new token based log
    • Optional: repeat to add second log for debugging

Deploy the script on AWS Lambda

  1. Create a new Lambda function

  2. On the "Select Blueprint" screen, press "Skip"

  3. Configure function:

    • Give your function a name
    • Set runtime to Python 2.7
  4. Upload function code:

    • Create a .ZIP file, containing le_cloudwatch.py and the folder certifi
      • Make sure the files and certifi folder are in the root of the ZIP archive
    • Choose "Upload a .ZIP file" in "Code entry type" dropdown and upload the archive created in previous step
  5. Lambda function handler and role

    • Change the "Handler" value to le_cloudwatch.lambda_handler
    • Create a new basic execution role (your IAM user must have sufficient permissions to create & assign new roles)
  6. Set Environment Variables:

    • Token value should match UUID provided by Logentries UI or API
    • Region should be that of your LE account - currently only eu
    Key Value
    region eu
    token token uuid
  7. Allocate resources:

    • Set memory to 128 MB
    • Set timeout to ~2 minutes (script only runs for seconds at a time)
  8. Enable function:

    • Click "Create function"

Configure CloudWatch Stream

  1. Create a new stream:

    • Select CloudWatch log group
    • Navigate to "Actions / Stream to AWS Lambda"

    Stream to Lambda

  2. Choose destination Lambda function:

    • Select the AWS Lambda function deployed earlier from drop down menu
    • Click "Next" at the bottom of the page

    Select Function

  3. Configure log format:

    • Choose the correct log format from drop down menu
    • Specify subscription filter pattern
    • Click "Next" at the bottom of the page

    Log Format

  4. Review and start log stream

    • Review your configuration and click "Start Streaming" at the bottom of the page

    Start stream

  5. Watch your logs come in:

le-aws-cloudwatch's People

Contributors

ardimehist-r7 avatar omgapuppy avatar pquinn-r7 avatar stephenhynes7 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.