tagFilters

package
v1.13.3 Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConcatorTagConfigs

func LoadConcatorTagConfigs(env string, plugins map[string]interface{}) (concatorcfgs map[string]*ConcatorCfg)

LoadConcatorTagConfigs return the configurations about dispatch rules

func ParseAddCfg

func ParseAddCfg(env string, cfg interface{}) map[string]map[string]string

Types

type BaseTagFilterFactory

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

func (*BaseTagFilterFactory) DiscardMsg

func (f *BaseTagFilterFactory) DiscardMsg(msg *libs.FluentMsg)

func (*BaseTagFilterFactory) SetDefaultIntervalChanSize

func (f *BaseTagFilterFactory) SetDefaultIntervalChanSize(size int)

func (*BaseTagFilterFactory) SetMsgPool

func (f *BaseTagFilterFactory) SetMsgPool(msgPool *sync.Pool)

func (*BaseTagFilterFactory) SetWaitCommitChan added in v1.12.2

func (f *BaseTagFilterFactory) SetWaitCommitChan(waitCommitChan chan<- *libs.FluentMsg)

type ConcatorCfg

type ConcatorCfg struct {
	MsgKey,
	Identifier string
	Regexp *regexp.Regexp
}

type ConcatorFactCfg

type ConcatorFactCfg struct {
	NFork, MaxLen int
	LBKey         string
	Plugins       map[string]*ConcatorCfg
}

type ConcatorFactory

type ConcatorFactory struct {
	*BaseTagFilterFactory
	*ConcatorFactCfg
	// contains filtered or unexported fields
}

ConcatorFactory can spawn new Concator

func NewConcatorFact

func NewConcatorFact(cfg *ConcatorFactCfg) *ConcatorFactory

NewConcatorFact create new ConcatorFactory

func (*ConcatorFactory) GetName

func (cf *ConcatorFactory) GetName() string

func (*ConcatorFactory) IsTagSupported

func (cf *ConcatorFactory) IsTagSupported(tag string) bool

func (*ConcatorFactory) Spawn

func (cf *ConcatorFactory) Spawn(ctx context.Context, tag string, outChan chan<- *libs.FluentMsg) chan<- *libs.FluentMsg

Spawn create and run new Concator for new tag

func (*ConcatorFactory) StartNewConcator added in v1.11.0

func (c *ConcatorFactory) StartNewConcator(ctx context.Context, cfg *ConcatorCfg, outChan chan<- *libs.FluentMsg, inChan <-chan *libs.FluentMsg)

StartNewConcator starting Concator to concatenate messages, you should not run concator directly, it's better to create and run Concator by ConcatorFactory

TODO: concator for each tag now, maybe set one concator for each identifier in the future for better performance

type ParserFact

type ParserFact struct {
	*BaseTagFilterFactory
	*ParserFactCfg
	// contains filtered or unexported fields
}

func NewParserFact

func NewParserFact(cfg *ParserFactCfg) *ParserFact

func (*ParserFact) GetName

func (cf *ParserFact) GetName() string

func (*ParserFact) IsTagSupported

func (cf *ParserFact) IsTagSupported(tag string) (ok bool)

func (*ParserFact) Spawn

func (cf *ParserFact) Spawn(ctx context.Context, tag string, outChan chan<- *libs.FluentMsg) chan<- *libs.FluentMsg

func (*ParserFact) StartNewParser added in v1.11.0

func (f *ParserFact) StartNewParser(ctx context.Context, outChan chan<- *libs.FluentMsg, inChan <-chan *libs.FluentMsg)

type ParserFactCfg

type ParserFactCfg struct {
	NFork           int
	Name, LBKey     string
	Tags            []string
	Env, MsgKey     string
	Regexp          *regexp.Regexp
	MsgPool         *sync.Pool
	IsRemoveOrigLog bool
	Add             map[string]map[string]string
	ParseJsonKey,
	MustInclude string
	TimeKey,
	TimeFormat,
	NewTimeKey,
	AppendTimeZone,
	NewTimeFormat string
	ReservedTimeKey bool
}

type PendingMsg

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

PendingMsg is the message wait tobe concatenate

type TagFilterFactoryItf

type TagFilterFactoryItf interface {
	IsTagSupported(string) bool
	Spawn(context.Context, string, chan<- *libs.FluentMsg) chan<- *libs.FluentMsg // Spawn(tag, outChan) inChan
	GetName() string

	SetMsgPool(*sync.Pool)
	SetWaitCommitChan(chan<- *libs.FluentMsg)
	SetDefaultIntervalChanSize(int)
	DiscardMsg(*libs.FluentMsg)
}

type TagPipeline

type TagPipeline struct {
	*TagPipelineCfg
	TagFilterFactoryItfs []TagFilterFactoryItf
	// contains filtered or unexported fields
}

func NewTagPipeline

func NewTagPipeline(ctx context.Context, cfg *TagPipelineCfg, itfs ...TagFilterFactoryItf) *TagPipeline

NewTagPipeline create new TagPipeline

func (*TagPipeline) Spawn

func (p *TagPipeline) Spawn(ctx context.Context, tag string, outChan chan<- *libs.FluentMsg) (chan<- *libs.FluentMsg, error)

Spawn create and run new Concator for new tag, return inchan

type TagPipelineCfg

type TagPipelineCfg struct {
	InternalChanSize int
	MsgPool          *sync.Pool
	WaitCommitChan   chan<- *libs.FluentMsg
}

type TagPipelineItf added in v1.11.0

type TagPipelineItf interface {
	Spawn(context.Context, string, chan<- *libs.FluentMsg) (chan<- *libs.FluentMsg, error)
}

Jump to

Keyboard shortcuts

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