GithubHelp home page GithubHelp logo

aiden / terraform-aws-cloudwatch-to-syslog-server Goto Github PK

View Code? Open in Web Editor NEW
12.0 5.0 8.0 44 KB

Terraform module to send CloudWatch logs to a syslog server. Compatible with papertrail, logstash, and datadog.

License: Other

Makefile 1.57% HCL 18.84% JavaScript 19.85% Go 59.75%
terraform terraform-module terratest aws cloudwatch-logs papertrail logstash datadog

terraform-aws-cloudwatch-to-syslog-server's Introduction

cloudwatch-to-syslog-server: A Terraform module to send CloudWatch logs to a syslog server

Maintained by aiden.ai CircleCI License: MIT

(This module is available both on GitHub and on the Terraform Registry.)

cloudwatch-to-syslog-server

cloudwatch-to-syslog-server is a Terraform module that defines an AWS Lambda function to forward the CloudWatch logs of a given log group to a syslog server. Many third-party services offer to collect logs with a syslog server, for instance:

Example

You can find an example Terraform configuration in the example folder.

Why cloudwatch-to-syslog-server?

AWS CloudWatch is meant for durable and scalable log archiving. It is tightly integrated with ECS and, overall, the AWS ecosystem, which makes it an interesting choice for low-cost, long-term log archiving. However, the browsing experience is poor, which is something other people have remarked (AWS CloudWatch logs for Humans, Elasticsearch+Kibana). In this context, Papertrail offers a seamless browsing experience that would be the equivalent, as a service, of a full-blown Elasticsearch cluster.

This repository is a full solution for forwarding the CloudWatch logs belonging to a specific log group to a syslog TCP server. Papertrail exposes such TCP servers, but our implementation can accommodate any syslog TCP server. (As a side note, Papertrail also exposes UDP servers, but we are subscribing to the CloudWatch logs, and UPD is not available on AWS Lambda, see the FAQ, "What restrictions apply to AWS Lambda function code?")

Other projects

This is a full solution written in Terraform, including an AWS Lambda function written for the NodeJS runtime. The code for this function has been adapted from https://github.com/apiaryio/cloudwatch-to-papertrail to add more reliability. We also have added end-to-end tests to make sure that the Terraform module as a whole fulfills its contract.

Hostnames and programs with syslog, and why it matters for ECS clusters

With the syslog format, the messages are tagged with a hostname and a program. Here, the hostname is equal to the name of the AWS CloudWatch log group, and the program is equal to a transformation of the AWS CloudWatch log stream. This transformation is specifically tailored to ECS clusters: if all the log streams within a cluster goes to the same log group, you then get one syslog hostname per cluster, and one syslog program per ECS service.

License

cloudwatch-to-syslog-server is licensed under the MIT License.

terraform-aws-cloudwatch-to-syslog-server's People

Contributors

hchauvin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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