Sign inSign up

diegohce/elasticlogger

By diegohce

Updated about 6 years ago

Docker log driver for elasticsearch

Plugin
0

194

diegohce/elasticlogger repository overview

Go Report Card Actions Status Actions Status GPLv3 license Maintenance

elasticlogger

Build & install from source

git clone https://github.com/diegohce/elasticlogger.git ~/go/src/elasticlogger
cd ~/go/src/elasticlogger
make

Pushing to registry

cd ~/go/src/elasticlogger
docker plugin create <registry>/elasticlogger:<tag> ./plugin-dir
docker plugin push <registry>/elasticlogger:<tag>

Installing from regisrtry

Make sure there's no previous elasticlogger installation from build process.

docker plugin ls

If there's any, remove them first.

docker plugin rm <plugin>:<tag>

Now, we can install elasticlogger from registry.

docker plugin install --alias elasticlogger <registry>/elasticlogger:<tag>

Optionally, you can set the HOST value at the same time.

docker plugin install --alias elasticlogger <registry>/elasticlogger:<tag> HOST=<elastichost:port>

Configuration

docker plugin set elasticlogger:latest HOST=http[s]://<elastic_host:port>
docker plugin enable elasticlogger:latest

Mandatory plugin settings

OptionDescription
HOSTElasticsearch server http[s]://host:port

Optional plugin settings

OptionDescriptionDefault
GCTIMERsets the garbage collector interval1m
LOG_LEVELsets the loglevel for the driver's own log entriesinfo
USERUser for basic auth 
PASSWORDPASSWORD for basic auth 
DATESUFFIXDate suffix pattern to append to index name. See Go time package200601
bulksizesets how many lines of log to send at a time10

Usage

docker run --log-driver elasticlogger --log-opt index=myappindex ...

Container level settings

OptionDescriptionDefault
indexElasticsearch index where logs will be storedNo default. Mandatory setting.
hostwill override driver hostplugin's HOST value
bulksizesets how many lines of log to send at a time10
USERUser for basic auth 
PASSWORDPASSWORD for basic auth 

Tag summary

Content type

Plugin

Digest

Size

28.2 MB

Last updated

about 6 years ago

docker plugin install diegohce/elasticlogger:0.1.1