beats: Index | Files

package redis

import ""

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.


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 Note: Filebeat is required to call the redis input's Run() method multiple times. It is expected to be called once initially when the input starts up and then again periodically, where the period is determined by the value of the `scan_frequency` setting. Also see

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 30 packages. Updated 2020-01-14. Refresh now. Tools for package owners.