beats: github.com/elastic/beats/filebeat/input/redis Index | Files

package redis

import "github.com/elastic/beats/filebeat/input/redis"

Package redis package contains input and harvester to read the redis slow log

The redis slow log is stored in memory. The slow log can be activate on the redis command line as following:

CONFIG SET slowlog-log-slower-than 2000000

This sets the value of the slow log to 2000000 micro seconds (2s). All queries taking longer will be reported.

As the slow log is in memory, it can be configured how many items it consists:

CONFIG SET slowlog-max-len 200

This sets the size of the slow log to 200 entries. In case the slow log is full, older entries are dropped.

Index

Package Files

config.go doc.go harvester.go input.go

func CreatePool Uses

func CreatePool(
    host, password, network string,
    maxConn int,
    idleTimeout, connTimeout time.Duration,
) *rd.Pool

CreatePool creates a redis connection pool NOTE: This code is copied from the redis pool handling in metricbeat

func NewInput Uses

func NewInput(cfg *common.Config, connector channel.Connector, context input.Context) (input.Input, error)

NewInput creates a new redis input

type Harvester Uses

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

Harvester contains all redis harvester data

func NewHarvester Uses

func NewHarvester(conn rd.Conn) (*Harvester, error)

NewHarvester creates a new harvester with the given connection

func (*Harvester) ID Uses

func (h *Harvester) ID() uuid.UUID

ID returns the unique harvester ID

func (*Harvester) Run Uses

func (h *Harvester) Run() error

Run starts a new redis harvester

func (*Harvester) Stop Uses

func (h *Harvester) Stop()

Stop stops the harvester

type Input Uses

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

Input is a input for redis

func (*Input) LoadStates Uses

func (p *Input) LoadStates(states []file.State) error

LoadStates loads the states

func (*Input) Run Uses

func (p *Input) Run()

Run runs the input

func (*Input) Stop Uses

func (p *Input) Stop()

Stop stops the input and all its harvesters

func (*Input) Wait Uses

func (p *Input) Wait()

Wait waits for the input to be completed. Not implemented.

Package redis imports 13 packages (graph) and is imported by 11 packages. Updated 2019-08-10. Refresh now. Tools for package owners.