Giter Club home page Giter Club logo

logspout-redis-logstash's Introduction

logspout-redis-logstash

Logspout adapter for writing Docker container stdout/stderr logs to Redis in Logstash jsonevent layout.

See the example below for more information.

Docker image available

Logspout including this adapter is available on Docker Hub. Pull it with:

$ docker pull rtoma/logspout-redis-logstash

How to use the Docker image

$ docker run -d --name logspout /var/run/docker.sock:/var/run/docker.sock:ro rtoma/logspout-redis-logstash redis://<your-redis-server>

Configuration

Some configuration can be passed via container environment keys. Some can be appended as query parameters to the endpoint.

Environment keys

Behaviour of the adapter can be changed by passing configuration via docker environment vars (e.g. -e key=val).

  • DEBUG=1: will enable logspout debug mode (default is disabled);
  • REDIS_PASSWORD=<password>: will force the adapter to do an AUTH to Redis (default is none);
  • REDIS_KEY=<key>: will configure the Redis list key to add events to (default is 'logspout');
  • REDIS_DOCKER_HOST=<host>: will add a docker.host= field, allows you to add the hostname of your docker host, identifying where your container was running (think mesos cluster);
  • REDIS_USE_V0_LAYOUT=1: logstash jsonevent layout v0 will be used (default is v1 layout).

Endpoint query parameters

Two keys can also be set as endpoint query parameters.

The REDIS_KEY can be set as redis://host?key=<key>.

The REDIS_USE_V0_LAYOUT switch can be set with ?use_v0_layout=1

ELK integration

Try out logspout with redis-logstash adapter in a full ELK stack. A docker-compose.yml can be found in the example/ directory.

When logspout with adapter is running. Executing something like:

docker run --rm centos:7 echo hello from a container

Will result in a corresponding event in Elasticsearch. Below is a screenshot from Kibana4:

Credits

Thanks to Gliderlabs for creating Logspout!

For other credits see the header of the redis.go source file.

logspout-redis-logstash's People

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.