inputredis

package
v0.0.0-...-c13075e Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 9 Imported by: 1

README

gogstash input redis

Synopsis

input:
  # type Must be "redis"
  - type: "redis"

    # redis server host:port, default: "localhost:6379"
    host: "localhost:6379"

    # where to get data, default: "gogstash"
    key: "gogstash"

    # maximum number of socket connections, default: 10
    connections: 10

    # (optional) The number of events to return from Redis using EVAL, default: 125
    batch_count: 125

    # (optional) BLPOP blocking timeout, default: "600s"
    blocking_timeout: "600s"

WARNING

redis client do not support golang context interface{} well, so interrupt signal from OS will not work

Documentation

Index

Constants

View Source
const ErrorTag = "gogstash_input_redis_error"

ErrorTag tag added to event when process module failed

View Source
const ModuleName = "redis"

ModuleName is the name used in config file

Variables

View Source
var (
	ErrorPingFailed = errutil.NewFactory("ping redis server failed")
)

errors

Functions

func InitHandler

func InitHandler(
	ctx context.Context,
	raw config.ConfigRaw,
	control config.Control,
) (config.TypeInputConfig, error)

InitHandler initialize the input plugin

Types

type InputConfig

type InputConfig struct {
	config.InputConfig
	Host        string `json:"host"`        // redis server host:port, default: "localhost:6379"
	DB          int    `json:"db"`          // redis db, default: 0
	Password    string `json:"password"`    // redis password, default: ""
	Key         string `json:"key"`         // where to get data, default: "gogstash"
	Connections int    `json:"connections"` // maximum number of socket connections, default: 10
	BatchCount  int    `json:"batch_count"` // The number of events to return from Redis using EVAL, default: 125

	// BlockingTimeout used for set the blocking timeout interval in redis BLPOP command
	// Defaults to 600s
	BlockingTimeout string `json:"blocking_timeout,omitempty"` // automatically
	// contains filtered or unexported fields
}

InputConfig holds the configuration json fields and internal objects

func DefaultInputConfig

func DefaultInputConfig() InputConfig

DefaultInputConfig returns an InputConfig struct with default values

func (*InputConfig) Start

func (i *InputConfig) Start(ctx context.Context, msgChan chan<- logevent.LogEvent) error

Start wraps the actual function starting the plugin

Jump to

Keyboard shortcuts

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