eventlog

package
v1.8.8 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, c creator)

Types

type Checkpoint

type Checkpoint struct {
	Name         string
	RecordNumber uint64
	Timestamp    time.Time
	Bookmark     string
}

Checkpoint represents the state of an individual event log.

type EventLog

type EventLog interface {
	// Open the event log. checkpoint points to the last successfully read event
	// in this event log. Read will resume from the next record. To start reading
	// from the first event specify a zero-valued Checkpoint.
	Open(checkpoint Checkpoint) error

	// Read records from the event log.
	Read() ([]Record, error)

	// Close the event log. It should not be re-opened after closing.
	Close() error

	// Name returns the event log's name.
	Name() string
}

EventLog is an interface to a Windows Event Log.

func NewEventLog

func NewEventLog(config EventLogConfig) (EventLog, error)

type EventLogConfig

type EventLogConfig struct {
	Context     pipeline.Context
	Name        string
	IgnoreOlder time.Duration
	EventID     string
	Level       string
	Provider    []string
}

EventLogConfig represents the config of EventLog.

type Record

type Record struct {
	sys.Event
	API    string     // The event log API type used to read the record.
	XML    string     // XML representation of the event.
	Offset Checkpoint // Position of the record within its source stream.
}

Record represents a single event from the log.

func (*Record) ToEvent

func (e *Record) ToEvent(ignoreZero bool) map[string]string

ToEvent convert record to map[string]string. @ignoreZero controls if zero value will be kept.

Directories

Path Synopsis
Thank elastic for these codes.
Thank elastic for these codes.

Jump to

Keyboard shortcuts

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