BisnodeInformatics/logspout-redis-logstash

Name: logspout-redis-logstash

Owner: Bisnode Informatics Deutschland

Description: Logspout adapter for writing Docker container logs to Redis in Logstash jsonevent layout

Forked from: rtoma/logspout-redis-logstash

Created: 2016-02-04 10:30:47.0

Updated: 2016-02-04 10:30:48.0

Pushed: 2016-05-27 11:59:28.0

Homepage: null

Size: 110

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

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:

cker pull rtoma/logspout-redis-logstash
How to use the Docker image
cker run -d --name logspout \
 /var/run/docker.sock:/var/run/docker.sock:ro \
oma/logspout-redis-logstash \
dis://<your-redis-server>?key=bla&...
Configuration

Some configuration can be passed via container environment keys.

Some can be passed via route options (e.g. logspout redis://<host>?key=foo&password=secret).

This table shows all configuration parameters:

| Parameter | Default | Environment key | Route option key | |———–|———|—————–|——————| | Enable debug, if set debug logging will be printed | disabled | DEBUG | debug | | Redis password, if set this will force the adapter to execute a Redis AUTH command | none | REDIS_PASSWORD | password | | Redis key, events will be pushed to this Redis list object | 'logspout' | REDIS_KEY | key | | Redis database, if set the adapter will execute a Redis SELECT command | 0 | REDIS_DATABASE | database | | Docker host, will add a docker.host= field to the event, allowing you to add the hostname of your host, identifying where your container was running (think mesos) | none | REDIS_DOCKER_HOST | docker_host | | Use Layout v0, what Logstash json format is used | false (meaning we use v1) | REDIS_USE_V0_LAYOUT | use_v0_layout | | Logstash type, if set the event will get a @type property | none | REDIS_LOGSTASH_TYPE | logstash_type |

Contribution

Want to add features? Feel welcome to submit a pull request!

If you are unable to code, feel free to create a issue describing your feature request or bug report.

Changelog
0.1.3
0.1.2
0.1.1
0.1.0
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:

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


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.