elasticsearch

package
v2.6.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2017 License: MIT Imports: 8 Imported by: 15

Documentation

Overview

Package elasticsearch implements an Elasticsearch batch handler.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BufferSize int           // BufferSize is the number of logs to buffer before flush (default: 100)
	Client     Elasticsearch // Client for ES
	Prefix     string        // Prefix for the index - The index will be prefix-YY-MM-DD (default: logs)
	Hostname   string        // Hostname to add to the logs
}

Config for handler.

type Elasticsearch

type Elasticsearch interface {
	Bulk(io.Reader) error
}

Elasticsearch interface.

type Handler

type Handler struct {
	*Config
	// contains filtered or unexported fields
}

Handler implementation.

func New

func New(config *Config) *Handler

New handler with BufferSize

func (*Handler) HandleLog

func (h *Handler) HandleLog(e *log.Entry) error

HandleLog implements log.Handler.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL