GithubHelp home page GithubHelp logo

ekristen / docker-plugin-multilogger Goto Github PK

View Code? Open in Web Editor NEW
2.0 4.0 0.0 1.04 MB

A docker multilogger as a plugin. Implements jsonlog + splunk loggers.

License: Apache License 2.0

Shell 5.73% Go 94.27%
docker splunk docker-plugin docker-logs splunk-hec

docker-plugin-multilogger's Introduction

multilogger - a logger docker plugin

Consider this currently as a work in progress, alpha/beta plugin. While it current works, I haven't riggerously tested it, so there could be performance or other edge cases that have not been addressed yet.

This implements a logger as a docker plugin that allows for logging to splunk and a json file that is internal to the plugin. The benefit to this is all the logs end up in splunk, but the command docker logs still works.

Credits

Thanks to cpuguy83 for the basis of this plugin, without him this would not exist. Thanks to docker for creating docker plugins!

Installation

docker plugin install ekristen/multilogger

Usage

After installation you can reference ekristen/multilogger as your logging driver, from there, all the jsonfile logger options and the splunk logger options are all valid and accepted. The only required options are splunk-url and splunk-token everything else is optional.

Example Usage

docker run -d --name "example-logger" \
  --log-driver ekristen/multilogger
  --log-opt max-file=2 \
  --log-opt max-size=10m \
  --log-opt splunk-url=https://localhost:8088 \
  --log-opt splunk-token=00000000-0000-0000-0000-000000000000 \
  --log-opt splunk-insecureskipverify=true \
  --log-opt splunk-source=my-source \
  --log-opt splunk-sourcetype=testing \
  --log-opt splunk-format=raw \
  --log-opt tag="" \
  ubuntu bash -c 'while true; do echo "{\"msg\": \"something\", \"time\": \"`date +%s`\"}"; sleep 2; done;'

Supported Drivers

  • json-file
  • splunk

JSON File Logging Driver

Documentation: https://docs.docker.com/engine/admin/logging/json-file/#options

Splunk Logging Driver

Documentation: https://docs.docker.com/engine/admin/logging/splunk/#splunk-options

Building

This plugin is using govendor to manage all it's dependencies along with multi-stage docker builds. You'll need docker 17.05-ce or later to support the build process.

bash build.sh

License

Apache License

docker-plugin-multilogger's People

Contributors

ekristen avatar

Stargazers

 avatar  avatar

Watchers

 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.