events

package
v0.0.1-dev-bc965b9 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Module     = "event"
	TimeLayout = "2006-01-02 15:04:05.999999999 -0700 MST"
)

Variables

This section is empty.

Functions

func GetFilterConditions

func GetFilterConditions() []string

func GetSeverityFullName

func GetSeverityFullName(severity string) string

func GetSeverityFullNames

func GetSeverityFullNames(severities []string) []string

func GetSeverityShortName

func GetSeverityShortName(severity string) string

func IsValidType

func IsValidType(t string) bool

Types

type Event

type Event struct {
	SearchIndex string         `json:"-"`
	Type        string         `json:"type"`
	Severity    string         `json:"severity"`
	Id          string         `json:"id"`
	Description string         `json:"description"`
	Host        string         `json:"host"`
	Category    string         `json:"category"`
	Service     string         `json:"service"`
	Metadata    map[string]any `json:"metadata"`
	Time        string         `json:"time"`
}

func (*Event) GenSearchableObject

func (e *Event) GenSearchableObject() Event

note: in the current search lib(bleve), the algo is not able to detect the string if it include uppercase we've tried a few different init settings, but the result is not as expected as always currenlty, the only way we found is to convert all the string to lower case and inject to searcher

func (*Event) GetSeverityFullName

func (e *Event) GetSeverityFullName() string

func (*Event) SetCategory

func (e *Event) SetCategory(metaObj map[string]any)

func (*Event) SetHostname

func (e *Event) SetHostname(metaObj map[string]any)

func (*Event) SetSearchIndex

func (e *Event) SetSearchIndex()

func (*Event) SetService

func (e *Event) SetService(metaObj map[string]any)

type Filter

type Filter struct {
	System   SystemFilter   `json:"system"`
	Instance InstanceFilter `json:"instance"`
	Host     HostFilter     `json:"host"`
}

type HostFilter

type HostFilter struct {
	Names      []string `json:"names"`
	Categories []string `json:"categories"`
}

type InstanceFilter

type InstanceFilter struct {
	Ids        []string `json:"ids"`
	Categories []string `json:"categories"`
}

type Stat

type Stat struct {
	Id           string  `json:"id"`
	Category     string  `json:"category"`
	Severity     string  `json:"severity,omitempty"`
	Host         string  `json:"host,omitempty"`
	InstanceId   string  `json:"instanceId,omitempty"`
	InstanceName string  `json:"instanceName,omitempty"`
	Percent      float64 `json:"percent"`
	Number       int64   `json:"number"`
}

type SystemFilter

type SystemFilter struct {
	Severities []string `json:"severities"`
	Categories []string `json:"categories"`
}

Jump to

Keyboard shortcuts

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