grokflux

package module
v0.0.0-...-07e1150 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2016 License: BSD-2-Clause Imports: 7 Imported by: 0 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

grokflux

Apply grok regexp patterns and send captured data to influxdb

Documentation

Index

Constants

View Source
const (
	// DefaultBatchSize sets how many points to batch to influx
	DefaultBatchSize = 64
	// DefaultQueueSize sets the size of the send queue
	DefaultQueueSize = 8192
	// DefaultPeriod sets how many seconds to flush the queu
	DefaultPeriod = 60
)

Variables

View Source
var (
	// Debug shows match results if enabled
	Debug bool

	// Directory specifies where to look for additional grok patterns
	Directory = "patterns"

	// ErrNoMatch is returned pattern did not match against input
	ErrNoMatch = fmt.Errorf("No match")
)

Functions

func Parse

func Parse(
	reader *bufio.Reader,
	s Sender,
	trans Translate,
	filters []Filter,
	tags map[string]string,
) error

Parse processes the data from reader line by line and sends results to influxdb as a data point

Types

type Filter

type Filter struct {
	Pattern string            // the grok pattern name
	Key     string            // the
	Good    []string          // list of keys of captured fields to use as values
	Tags    []string          // list of keys of captured fields to use as tags
	Valid   map[string]string // an optional map of values where
}

Filter defines a secondary groking of a result set

type InfluxConfig

type InfluxConfig struct {
	Host     string
	Username string
	Password string
	Port     int
	Batch    client.BatchPointsConfig
}

InfluxConfig defines connection requirements

func (*InfluxConfig) NewSender

func (cfg *InfluxConfig) NewSender(batchSize, queueSize, period int) (Sender, error)

NewSender returns a function that accepts datapoints for sending to influx

type Sender

type Sender func(string, map[string]string, map[string]interface{}, time.Time) error

Sender maps the arguents needed to write an InfluxDB datapoint

type Translate

type Translate struct {
	Pattern  string   // Pattern to apply when parsing data
	Key      string   // Lookup the value of Key, if found use it as point name, otherwise use Key itself
	TSLayout string   // Timestamp Layout for parsing
	TSField  string   // Field to be parsed for timestamp
	TFields  []string // List of tag fields to use
	VFields  []string // List of fields to use for values
}

Translate controls how the grok results are converted to a data point

Jump to

Keyboard shortcuts

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