formats

package
v0.0.0-...-2ec37ed Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EvConnection = iota
	EvExec
)

events types

View Source
const CSV = "csv"

CSV name of the output format, used in json configs

View Source
const JSON = "json"

JSON name of the output format, used in our json config

View Source
const RFC3164 = "rfc3164"

RFC3164 name of the output format, used in our json config

View Source
const RFC5424 = "rfc5424"

RFC5424 name of the output format, used in our json config

Variables

This section is empty.

Functions

This section is empty.

Types

type Csv

type Csv struct {
}

Csv object

func NewCSV

func NewCSV() *Csv

NewCSV returns a new CSV transformer object.

func (*Csv) Transform

func (c *Csv) Transform(args ...interface{}) (out string)

Transform takes input arguments and formats them to CSV.

type JSONEventFormat

type JSONEventFormat struct {
	Event  interface{} `json:"Event"`
	Rule   string      `json:"Rule"`
	Action string      `json:"Action"`
	Type   uint8       `json:"Type"`
}

JSONEventFormat object to be sent to the remote service. TODO: Expand as needed: ebpf events, etc.

func NewJSON

func NewJSON() *JSONEventFormat

NewJSON returns a new Json format, to send events as json. The json is the protobuffer in json format.

func (*JSONEventFormat) Transform

func (j *JSONEventFormat) Transform(args ...interface{}) (out string)

Transform takes input arguments and formats them to JSON format.

type LoggerFormat

type LoggerFormat interface {
	Transform(...interface{}) string
}

LoggerFormat is the common interface that every format must meet. Transform expects an arbitrary number of arguments and types, and it must transform them to a string. Arguments can be of type Connection, string, int, etc.

type Rfc3164

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

Rfc3164 object

func NewRfc3164

func NewRfc3164() *Rfc3164

NewRfc3164 returns a new Rfc3164 object, that transforms a message to RFC3164 format.

func (*Rfc3164) Transform

func (r *Rfc3164) Transform(args ...interface{}) (out string)

Transform takes input arguments and formats them to RFC3164 format.

type Rfc5424

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

Rfc5424 object

func NewRfc5424

func NewRfc5424() *Rfc5424

NewRfc5424 returns a new Rfc5424 object, that transforms a message to RFC5424 format (sort of).

func (*Rfc5424) Transform

func (r *Rfc5424) Transform(args ...interface{}) (out string)

Transform takes input arguments and formats them to RFC5424 format.

Jump to

Keyboard shortcuts

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