logstash

package module
Version: v0.0.0-...-c399bbe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2015 License: Apache-2.0 Imports: 5 Imported by: 0

README

logspout-logstash

A minimalistic adapter for github.com/gliderlabs/logspout to write to Logstash UDP

Follow the instructions in https://github.com/gliderlabs/logspout/tree/master/custom on how to build your own Logspout container with custom modules. Basically just copy the contents of the custom folder and include:

import (
  _ "github.com/looplab/logspout-logstash"
  _ "github.com/gliderlabs/logspout/transports/udp"
)

in modules.go.

Use by setting ROUTE_URIS=logstash://host:port to the Logstash host and port for UDP.

In your logstash config, set the input codec to json e.g:

input { udp { port => 5000 codec => json } }

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogstashAdapter

func NewLogstashAdapter(route *router.Route) (router.LogAdapter, error)

NewLogstashAdapter creates a LogstashAdapter with UDP as the default transport.

Types

type LogstashAdapter

type LogstashAdapter struct {
	// contains filtered or unexported fields
}

LogstashAdapter is an adapter that streams UDP JSON to Logstash.

func (*LogstashAdapter) Stream

func (a *LogstashAdapter) Stream(logstream chan *router.Message)

Stream implements the router.LogAdapter interface.

type LogstashMessage

type LogstashMessage struct {
	Message  string `json:"message"`
	Name     string `json:"docker_name"`
	ID       string `json:"docker_id"`
	Image    string `json:"docker_image"`
	Hostname string `json:"docker_hostname"`
}

LogstashMessage is a simple JSON input to Logstash.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL