Git Product home page Git Product logo

journald-to-cloudwatch's Introduction

journald-to-cloudwatch

This tool is no longer under active development. If you are interested in taking over or repurposing the name on crates.io, feel free to contact me: [email protected]

This is a simple service that copies logs from journald to AWS CloudWatch Logs.

The implementation is very basic. It does not copy logs that were created prior to journald-to-cloudwatch starting. It has only one configuration option, which is the name of the log group. The log stream name is derived from the instance name (the service assumes it is running on an EC2 instance).

Usage

To build the service for EC2:

tools/package.py

This builds in a Docker container that has the libraries an awslinux2 EC2 instance would have.

The output is release/journald-to-cloudwatch-{version}.tar.gz. Copy that to an EC2 instance. There is an example service configuration file in the tarball. Copy that to /etc/systemd/system/ and modify LOG_GROUP_NAME to the name of your log group. Note that the log group must exist for the service to work; it will not create the log group.

IAM policy

The following permissions are required:

logs:CreateLogStream
logs:DescribeLogStreams
logs:PutLogEvents

journald-to-cloudwatch's People

Contributors

nicholasbishop avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

offbyone

journald-to-cloudwatch's Issues

Updates to the package?

Hey, Nicholas.

I've got a need for a component that does this, and I was wondering how you'd feel about either a 2.0 with changes or a fork.

The changes I've made on my branch are:

  • use the instance ID for the stream name instead of looking up the instance name from the EC2 API (it drops one of the permission requirements for the instance role)
  • migrate to the AWS SDK for Rust, from Rusoto.
  • switch to tokio for an async framework
  • upgrade to a newer systemd library, with corresponding API changes

I was considering possibly offering a config file option to narrow which units are published up, or which log group to use (in lieu of the environment variable) as well.

Do you still use this?

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.