Documentation ¶
Overview ¶
Package eflowlog provides primitives for searching and processing data in FlowMessage files.
Index ¶
- func FlowLogChecker(loader loaders.Loader, devUUID uuid.UUID, q map[string]string, ...) (err error)
- func FlowLogItemFind(le *flowlog.FlowMessage, query map[string]string) bool
- func FlowLogItemPrint(le *flowlog.FlowMessage, query []string) *types.PrintResult
- func FlowLogLast(loader loaders.Loader, query map[string]string, handler HandlerFunc) error
- func FlowLogPrn(le *flowlog.FlowMessage, format types.OutputFormat)
- func FlowLogWatch(loader loaders.Loader, query map[string]string, handler HandlerFunc, ...) error
- func ParseFullLogEntry(data []byte) (*flowlog.FlowMessage, error)
- type FlowLogCheckerMode
- type HandlerFunc
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 ¶
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, format types.OutputFormat)
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(format types.OutputFormat, once bool) HandlerFunc
HandleFactory implements HandlerFunc which prints log in the provided format