Giter Site home page Giter Site logo

udaivizury / log-courier Goto Github PK

View Code? Open in Web Editor NEW

This project forked from driskell/log-courier

0.0 1.0 0.0 1.83 MB

Log Courier, a lightweight log shipper with Logstash integration.

License: Other

Ruby 30.72% Makefile 1.56% Shell 2.29% Go 65.43%

log-courier's Introduction

Log Courier

Build Status Latest Release

Log Courier is a lightweight tool created to ship log files speedily and securely, with low resource usage, to remote Logstash instances. The project is an enhanced fork of Logstash Forwarder 0.3.1 with many fixes and behavioural improvements.

Table of Contents generated with DocToc

Features

  • Logstash Integration with an input and output plugin
  • Read events from a file or a Unix pipeline
  • Follow log file rotations and movements
  • Close files after inactivity, reopening on change, to keep resource usage low
  • Add extra fields to events prior to shipping
  • Reload configuration without restarting
  • Monitor shipping speed and status with the Administration utility
  • Pre-process events using codecs (e.g. Multiline, Filter)
  • Ship events securely using TLS with server (and optionally client) certificate verification
  • Ship events in plaintext using TCP

Philosophy

  • Aim to guarantee at-least-once delivery of events to the Logstash pipeline - a Log Courier crash should never lose events [1]
  • Be efficient and reliable
  • Keep resource usage low

[1] A Logstash crash or output failure will still lose some events until Logstash itself implements delivery guarantees or persistence - see elastic/logstash#2609 and elastic/logstash#2605. Log Courier aims to provide complete compatibility with theses features as they develop.

Differences to Logstash Forwarder

Log Courier is an enhanced fork of Logstash Forwarder 0.3.1 with many fixes and behavioural improvements. The primary changes are:

  • The publisher protocol is rewritten to avoid many causes of "i/o timeout" which would result in duplicate events sent to Logstash
  • The prospector and registrar are heavily revamped to handle log rotations and movements far more reliably, and to report errors cleanly
  • The harvester is improved to retry if an error occurred rather than stop
  • The configuration can be reloaded without restarting
  • An administration tool is available which can display the shipping speed and status of all watched log files
  • Fields configurations can contain arrays and dictionaries, not just strings
  • Codec support is available which allows multiline processing at the sender side
  • A TCP transport is available which removes the requirement for SSL certificates
  • There is support for client SSL certificate verification
  • Peer IP address and certificate DN can be added to received events in Logstash to distinguish events send from different instances
  • Windows: Log files are not locked allowing log rotation to occur
  • Windows: Log rotation is detected correctly

Public Repositories

Redhat / CentOS

The Log Courier repository depends on the EPEL repository which can be installed automatically on CentOS distributions by running yum install epel-release. For other distributions, please follow the installation instructions on the EPEL homepage.

To install the Log Courier YUM repository, download the corresponding .repo configuration file below, and place it in /etc/yum.repos.d. Log Courier may then be installed using yum install log-courier.

Once installed, create a configuration file at /etc/log-courier/log-courier.conf to suit your needs, then start the Log Courier service to begin shipping.

service log-courier start

Ubuntu

To install the Log Courier apt-get repository, run the following commands.

sudo add-apt-repository ppa:devel-k/log-courier
sudo apt-get update

Log Courier may then be installed using apt-get install log-courier.

Once installed, create a configuration file at /etc/log-courier/log-courier.conf to suit your needs, then start the Log Courier service to begin shipping.

service log-courier start

NOTE: The Ubuntu packages have had limited testing and you are welcome to give feedback and raise feature requests or bug reports to help improve them!

Building from Source

Requirements:

  1. Linux, Unix, OS X or Windows
  2. GNU make
  3. git
  4. The Golang compiler tools (1.2-1.4)

Linux / Unix / OS X

Most requirements are usually available via your distribution's package manager. On OS X, Git and GNU make are provided automatically by XCode.

Run the following commands to download and build Log Courier.

git clone https://github.com/driskell/log-courier
cd log-courier
make

Note: If you receive errors whilst running make, try gmake instead.

Windows

Installing msysGit will provide you with Git and GNU make, and a Unix-like environment to build within.

Run the following commands to download and build Log Courier, changing the path to the Golang installation if necessary (the default is C:\Go, which in msys terms is /c/Go.)

export GOROOT=/c/Go
export PATH=$PATH:$GOROOT/bin
git clone https://github.com/driskell/log-courier
cd log-courier
make

Results

The log-courier program can then be found in the 'bin' folder. Service scripts for various platforms can be found in the contrib/initscripts folder, or it can be run on the command line:

bin/log-courier -config /path/to/config.conf

Logstash Integration

Log Courier communicates with Logstash via an input plugin called "courier".

You may install the plugin using the Logstash 1.5 Plugin manager. Run the following as the user Logstash was installed with.

cd /path/to/logstash
bin/plugin install logstash-input-courier

Detailed instructions, including integration with Logstash 1.4.x, can be found on the Logstash Integration page.

Note: If you receive a Plugin Conflict error, try updating the zeromq output plugin first using bin/plugin update logstash-output-zeromq

Generating Certificates

Log Courier provides a commands to help generate SSL certificates: lc-tlscert. This utility is also bundled with the packaged versions of Log Courier, and should be immediately available at the command-line.

When building from source, running make selfsigned will automatically build and run the lc-tlscert utility that can quickly and easily generate a self-signed certificate, along with the corresponding configuration snippets, for the 'tls' transport.

Documentation

log-courier's People

Contributors

driskell avatar jordansissel avatar nickethier avatar igalic avatar jamtur01 avatar tzahari avatar willie avatar atwardowski avatar avleen avatar solarce avatar camerondavison avatar donjohnson avatar shurane avatar kargig avatar josegonzalez avatar cyberplant avatar lblasc avatar yggdrasil avatar matejzero avatar mcnewton avatar promisedlandt avatar pilif avatar yath avatar shoenig avatar tedder avatar mheese avatar sgzijl 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.