Giter Club home page Giter Club logo

oklog-docker-plugin's Introduction

oklog-docker-plugin ๐Ÿ“

Forwards your container logs to OKLog ingestors

docker-oklog-driver is a custom Docker logging plugin that implements the log driver interface and acts as an OKLog forwarder.

Install

# Install the plugin `cirocosta/oklog-docker-plugin`
# and then make it aliased to `oklog` so that we can
# make use of it via the alias.
#
# INGESTER configures the host name to use to look 
# for ingester nodes.
docker plugin install \
        --alias oklog \
        cirocosta/oklog-docker-plugin \
        INGESTER=127.0.0.1:7651


# Run a container with `oklog` being used as the log
# plugin. 
docker run \
        --log-driver oklog \
        alpine echo lol

# Query oklog for the the last logs stored in the last
# 1m
oklog query -from 1m
cid=f034d50a48a964cc5ef7b4dd678cc155246de8209c32a25891cfe81c9ce296fc lol


# Run a container with `oklog` as the log plugin but
# capturing the labels specified so that we can query
# against them in the future.
docker run \
        --log-driver oklog \
        --log-opt labels=foo \
        --label foo=bar \
        alpine echo lol2

# Query all the logs from the last 3min
oklog query -from 3m
cid=f034d50a48a964cc5ef7b4dd678cc155246de8209c32a25891cfe81c9ce296fc lol
cid=fcf89d4cd2a6bcb33b50cb21fe29d4245efb473e94e8b427fb252ed298434dc1 foo=bar lol2

# Query all the logs from the last 3min but only
# those that container `foo=bar`
oklog query -from 3m -q foo=bar
cid=fcf89d4cd2a6bcb33b50cb21fe29d4245efb473e94e8b427fb252ed298434dc1 foo=bar lol2

oklog-docker-plugin's People

Stargazers

Julien avatar Denis Denisov avatar

Watchers

James Cloos avatar  avatar

oklog-docker-plugin's Issues

Configure pool and flushing behavior

Something like:

# MAX_CONNS specifies a maximum size of the connection
# pool to keep connected  to ingester nodes.
#
# FLUSH_INTERVAL specifies the interval between flushes.
#
# MAX_BUFFER_SIZE specifies the maximum size that the
# internl buffer can hold before flushing if the configured
# flush interval is not satisfied.

Pay attention to

  • "one-off" executions where the container runs for a period < than the flush interval;
  • trailing logs

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.