collector

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventCollector

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

EventCollector aggregates and groups CloudTrail events for alerting

func NewEventCollector

func NewEventCollector(alertFunc func(*GroupedRecord, handler.Record)) *EventCollector

NewEventCollector creates a new EventCollector instance

func (*EventCollector) AddRecord

func (ec *EventCollector) AddRecord(record map[string]interface{}, userName, eventName, errorCode string, eventTime time.Time, eventRecord handler.Record)

AddRecord adds a CloudTrail record to the collector, grouping similar events

func (*EventCollector) SendAllAlerts

func (ec *EventCollector) SendAllAlerts()

SendAllAlerts sends alerts for all collected event groups

type GroupKey

type GroupKey struct {
	UserName  string
	EventName string
	ErrorCode string
}

GroupKey uniquely identifies a group of related CloudTrail events

type GroupedRecord

type GroupedRecord struct {
	Record         map[string]interface{}
	UserName       string
	EventName      string
	ErrorCode      string
	Count          int
	FirstEventTime time.Time
	LastEventTime  time.Time
}

GroupedRecord represents a collection of similar CloudTrail events

Jump to

Keyboard shortcuts

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