udpbeat

package module
v0.0.0-...-5a6f974 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2021 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Udpbeat

ELK beat that collects the structured inputs via UDP and emits them to ELK

Status: expermental, use at your own risk

Setup

Add trace's document template to your ElasticSearch cluster**

curl -XPUT 'http://localhost:9200/_template/trace' -d@udbbeat/template.json

Start udpbeat UDP logs collector and emitter

go install github.com/gravitational/udpbeat
udpbeat

Start emitting logs to UDP socket via github.com/gravitational/trace UDP hook and enjoy structured logs!

Documentation

Index

Constants

View Source
const (
	// ELKType is ELK-required type field
	ELKType = "type"
	// ELKTimestamp is a timestamp required by ELK
	ELKTimestamp = "@timestamp"
	// ELKEntry is an object with events set by logrus
	ELKEntry = "entry"
	// ELKMessage contains user friendly message
	ELKMessage = "message"
	// ELKTrace is an object with trace data
	ELKTrace = "trace"
	// ELKBeatName is a beat name for ELKHook
	ELKBeatName = "trace"
	// ELKBeatVersion is a current version
	ELKBeatVersion = "0.0.1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ELK

type ELK struct {
	Clock clockwork.Clock

	SetupC chan bool
	// contains filtered or unexported fields
}

ELK implements Elasticsearch-compatible logrus hook ELK's template is stored in template.json To initialize this template, use: curl -XPUT 'http://localhost:9200/_template/trace' -d@template.json

func NewELK

func NewELK(opts ...ELKOptionSetter) *ELK

NewELK returns logrus-compatible hook that sends data to ELK

func (*ELK) Cleanup

func (elk *ELK) Cleanup(b *beat.Beat) error

Cleanup is a callback to cleanup any allocated resources

func (*ELK) Config

func (elk *ELK) Config(b *beat.Beat) error

Config configures ELKHook beat parameters read more about beats here: https://www.elastic.co/guide/en/beats/libbeat/current/new-beat.html#config-method

func (*ELK) Run

func (elk *ELK) Run(b *beat.Beat) error

Run is called by ELK

func (*ELK) Setup

func (elk *ELK) Setup(b *beat.Beat) error

Setup initializes beat object

func (*ELK) Stop

func (elk *ELK) Stop()

Stop is a callback to stop everything

type ELKOptionSetter

type ELKOptionSetter func(f *ELK)

ELKOptionSetter represents functional arguments passed to ELKHook

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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