loggingdrain

package module
v0.0.0-...-a719de8 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: MIT Imports: 11 Imported by: 0

README

LoggingDrain

Introduce

LoggingDrain is go implemented for drain3

Example

go run examples/stdin.go

Test

run unittest

go test .

run benchmark

go test -bench=.
goos: darwin
goarch: arm64
pkg: github.com/palanqu/loggingdrain
BenchmarkBuildTree-8       	 1632832	       699.0 ns/op
BenchmarkMatchTree-8       	 3431210	       349.4 ns/op
BenchmarkUnmarshalJson-8   	  378432	      3172 ns/op
PASS
ok  	github.com/palanqu/loggingdrain	4.840s

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithDrainDepth

func WithDrainDepth(depth int) minerOption

func WithDrainMaxChildren

func WithDrainMaxChildren(maxChildren int) minerOption

func WithDrainMaxCluster

func WithDrainMaxCluster(maxCluster int) minerOption

func WithDrainSim

func WithDrainSim(sim float32) minerOption

func WithMaskInsturction

func WithMaskInsturction(pattern, maskWith string) minerOption

func WithMaskPrefix

func WithMaskPrefix(prefix string) minerOption

func WithMaskSuffix

func WithMaskSuffix(suffix string) minerOption

Types

type ClusterUpdateType

type ClusterUpdateType int
const (
	CLUSTER_UPDATE_TYPE_NONE ClusterUpdateType = iota
	CLUSTER_UPDATE_TYPE_NEW_CLUSTER
	CLUSTER_UPDATE_TYPE_UPDATE_CLUSTER
)

type InternalError

type InternalError struct{}

func (InternalError) Error

func (InternalError) Error() string

type LogCluster

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

func (*LogCluster) MarshalJSON

func (cluster *LogCluster) MarshalJSON() ([]byte, error)

func (*LogCluster) UnmarshalJSON

func (cluster *LogCluster) UnmarshalJSON(data []byte) error

type LogMessageResponse

type LogMessageResponse struct {
	ChangeType    ClusterUpdateType
	Cluster       *LogCluster
	TemplateMined string
	ClusterCount  int
}

type MaskPatternError

type MaskPatternError struct{}

func (MaskPatternError) Error

func (MaskPatternError) Error() string

type RedisClient

type RedisClient interface {
	Set(ctx context.Context, key string, value interface{}, expiration time.Duration) *redis.StatusCmd
	Get(ctx context.Context, key string) *redis.StringCmd
	Subscribe(ctx context.Context, channels ...string) *redis.PubSub
}

RedisClient for mock testing

type RedisPersistence

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

func NewRedisPersistence

func NewRedisPersistence(addr, password string, db int, serviceKey string) *RedisPersistence

func (*RedisPersistence) Load

func (*RedisPersistence) Save

func (p *RedisPersistence) Save(ctx context.Context, template *TemplateMiner) error

func (*RedisPersistence) Subscribe

func (p *RedisPersistence) Subscribe(ctx context.Context) *redis.PubSub

type SearchStrategy

type SearchStrategy int
const (
	SEARCH_STRATEGY_NEVER SearchStrategy = iota
	SEARCH_STRATEGY_FALLBACK
	SEARCH_STRATEGY_ALWAYS
)

type TemplateMiner

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

func NewTemplateMiner

func NewTemplateMiner(options ...minerOption) (*TemplateMiner, error)

func (*TemplateMiner) AddLogMessage

func (miner *TemplateMiner) AddLogMessage(message string) *LogMessageResponse

func (*TemplateMiner) MarshalJSON

func (miner *TemplateMiner) MarshalJSON() ([]byte, error)

func (*TemplateMiner) Match

func (miner *TemplateMiner) Match(message string) *LogCluster

func (*TemplateMiner) Status

func (miner *TemplateMiner) Status() string

func (*TemplateMiner) UnmarshalJSON

func (miner *TemplateMiner) UnmarshalJSON(data []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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