eflowlog

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package eflowlog provides primitives for searching and processing data in FlowMessage files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlowLogChecker

func FlowLogChecker(loader loaders.Loader, devUUID uuid.UUID, q map[string]string, handler HandlerFunc, mode FlowLogCheckerMode, timeout time.Duration) (err error)

FlowLogChecker check logs by pattern from existence files with FlowLogLast and use FlowLogWatchWithTimeout with timeout for observe new files

func FlowLogItemFind

func FlowLogItemFind(le *flowlog.FlowMessage, query map[string]string) bool

FlowLogItemFind find FlowMessage records by reqexps in 'query' corresponded to FlowMessage structure.

func FlowLogItemPrint

func FlowLogItemPrint(le *flowlog.FlowMessage, query []string) *types.PrintResult

FlowLogItemPrint find FlowMessage elements by paths in 'query'

func FlowLogLast

func FlowLogLast(loader loaders.Loader, query map[string]string, handler HandlerFunc) error

FlowLogLast function process FlowLog files in the 'filepath' directory according to the 'query' reqexps and return last founded item

func FlowLogPrn

func FlowLogPrn(le *flowlog.FlowMessage)

FlowLogPrn print FlowMessage data

func FlowLogWatch

func FlowLogWatch(loader loaders.Loader, query map[string]string, handler HandlerFunc, timeoutSeconds time.Duration) error

FlowLogWatch monitors the change of FlowLog files in the 'filepath' directory according to the 'query' reqexps and processing using the 'handler' function.

func ParseFullLogEntry

func ParseFullLogEntry(data []byte) (*flowlog.FlowMessage, error)

ParseFullLogEntry unmarshal FlowMessage

Types

type FlowLogCheckerMode

type FlowLogCheckerMode int

FlowLogCheckerMode is FlowLogExist, FlowLogNew and FlowLogAny

const (
	FlowLogExist FlowLogCheckerMode = -3 // just look to existing files
	FlowLogNew   FlowLogCheckerMode = -2 // wait for new files
	FlowLogAny   FlowLogCheckerMode = -1 // use both mechanisms
)

FlowLogChecker modes FlowLogExist, FlowLogNew and FlowLogAny.

func FlowLogTail

func FlowLogTail(count uint) FlowLogCheckerMode

FlowLogTail returns FlowLogCheckerMode for process only defined count of last messages

type HandlerFunc

type HandlerFunc func(*flowlog.FlowMessage) bool

HandlerFunc must process FlowMessage and return true to exit or false to continue

func HandleFactory

func HandleFactory(once bool) HandlerFunc

HandleFactory implements HandlerFunc which prints log in the provided format

Jump to

Keyboard shortcuts

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