Documentation ¶
Index ¶
- Constants
- Variables
- func CastBool(value interface{}) bool
- func CastFloat64(value interface{}) float64
- func CastInt64(value interface{}) int64
- func CastString(value interface{}) string
- func DoReq[response any](url string, data []byte, method string, headers map[string]string) (response, int, *logger.Error)
- func Download(url, file string) *logger.Error
- func EnqueueNotification[T any](topic Topic, message T) *logger.Error
- func GetCelType(t string) *cel.Type
- func GetMainIP() (string, *logger.Error)
- func GetValueOf(value gjson.Result) interface{}
- func ListFiles(route string, filter string) []string
- func Logger() *logger.Logger
- func PluginCfg[t any](name string) (*t, *logger.Error)
- func PointerOf[t any](s t) *t
- func ReadCSV(url string) ([][]string, *logger.Error)
- func ReadJSON[t any](f string) (*t, *logger.Error)
- func ReadPbYaml(f string) ([]byte, *logger.Error)
- func ReadYaml[t any](f string, jsonMode bool) (*t, *logger.Error)
- func RegisterAnalysisServer(s grpc.ServiceRegistrar, srv AnalysisServer)
- func RegisterCorrelationServer(s grpc.ServiceRegistrar, srv CorrelationServer)
- func RegisterEngineServer(s grpc.ServiceRegistrar, srv EngineServer)
- func RegisterIntegrationServer(s grpc.ServiceRegistrar, srv IntegrationServer)
- func RegisterNotificationServer(s grpc.ServiceRegistrar, srv NotificationServer)
- func RegisterParsingServer(s grpc.ServiceRegistrar, srv ParsingServer)
- func SendNotificationsFromChannel() *logger.Error
- func ToObject(str *string, object protoreflect.ProtoMessage) *logger.Error
- func ToString(object protoreflect.ProtoMessage) (*string, *logger.Error)
- type Ack
- type Add
- type Alert
- func (*Alert) Descriptor() ([]byte, []int)deprecated
- func (x *Alert) GetAdversary() *Side
- func (x *Alert) GetCategory() string
- func (x *Alert) GetDataSource() string
- func (x *Alert) GetDataType() string
- func (x *Alert) GetDescription() string
- func (x *Alert) GetEvents() []string
- func (x *Alert) GetId() string
- func (x *Alert) GetImpact() *Impact
- func (x *Alert) GetImpactScore() int32
- func (x *Alert) GetLastUpdate() string
- func (x *Alert) GetName() string
- func (x *Alert) GetReferences() []string
- func (x *Alert) GetSeverity() string
- func (x *Alert) GetTarget() *Side
- func (x *Alert) GetTechnique() string
- func (x *Alert) GetTenantId() string
- func (x *Alert) GetTenantName() string
- func (x *Alert) GetTimestamp() string
- func (*Alert) ProtoMessage()
- func (x *Alert) ProtoReflect() protoreflect.Message
- func (x *Alert) Reset()
- func (x *Alert) String() string
- type AnalysisClient
- type AnalysisServer
- type Analysis_AnalyzeClient
- type Analysis_AnalyzeServer
- type Asset
- func (*Asset) Descriptor() ([]byte, []int)deprecated
- func (x *Asset) GetAvailability() int32
- func (x *Asset) GetConfidentiality() int32
- func (x *Asset) GetHostnames() []string
- func (x *Asset) GetIntegrity() int32
- func (x *Asset) GetIps() []string
- func (x *Asset) GetName() string
- func (*Asset) ProtoMessage()
- func (x *Asset) ProtoReflect() protoreflect.Message
- func (x *Asset) Reset()
- func (x *Asset) String() string
- type Cast
- type Config
- func (*Config) Descriptor() ([]byte, []int)deprecated
- func (x *Config) GetDisabledRules() []int64
- func (x *Config) GetEnv() *Env
- func (x *Config) GetPatterns() map[string]string
- func (x *Config) GetPipeline() []*Pipeline
- func (x *Config) GetPlugins() map[string]*structpb.Value
- func (x *Config) GetTenants() []*Tenant
- func (*Config) ProtoMessage()
- func (x *Config) ProtoReflect() protoreflect.Message
- func (x *Config) Reset()
- func (x *Config) String() string
- type CorrelationClient
- type CorrelationServer
- type Csv
- func (*Csv) Descriptor() ([]byte, []int)deprecated
- func (x *Csv) GetHeaders() []string
- func (x *Csv) GetSeparator() string
- func (x *Csv) GetSource() string
- func (x *Csv) GetWhere() *Where
- func (*Csv) ProtoMessage()
- func (x *Csv) ProtoReflect() protoreflect.Message
- func (x *Csv) Reset()
- func (x *Csv) String() string
- type DataProcessingMessage
- type Delete
- type Drop
- type Dynamic
- func (*Dynamic) Descriptor() ([]byte, []int)deprecated
- func (x *Dynamic) GetParams() map[string]*structpb.Value
- func (x *Dynamic) GetPlugin() string
- func (x *Dynamic) GetWhere() *Where
- func (*Dynamic) ProtoMessage()
- func (x *Dynamic) ProtoReflect() protoreflect.Message
- func (x *Dynamic) Reset()
- func (x *Dynamic) String() string
- type Empty
- type EngineClient
- type EngineServer
- type Engine_InputClient
- type Engine_InputServer
- type Engine_NotifyClient
- type Engine_NotifyServer
- type Env
- func (*Env) Descriptor() ([]byte, []int)deprecated
- func (x *Env) GetLogLevel() int64
- func (x *Env) GetNodeGroups() []string
- func (x *Env) GetNodeName() string
- func (x *Env) GetWorkdir() string
- func (*Env) ProtoMessage()
- func (x *Env) ProtoReflect() protoreflect.Message
- func (x *Env) Reset()
- func (x *Env) String() string
- type Event
- func (*Event) Descriptor() ([]byte, []int)deprecated
- func (x *Event) GetAction() string
- func (x *Event) GetActionResult() string
- func (x *Event) GetCommand() string
- func (x *Event) GetConnectionStatus() string
- func (x *Event) GetDataSource() string
- func (x *Event) GetDataType() string
- func (x *Event) GetDeviceTime() string
- func (x *Event) GetId() string
- func (x *Event) GetLog() map[string]*structpb.Value
- func (x *Event) GetOrigin() *Side
- func (x *Event) GetProtocol() string
- func (x *Event) GetRaw() string
- func (x *Event) GetStatusCode() int64
- func (x *Event) GetTarget() *Side
- func (x *Event) GetTenantId() string
- func (x *Event) GetTenantName() string
- func (x *Event) GetTimestamp() string
- func (*Event) ProtoMessage()
- func (x *Event) ProtoReflect() protoreflect.Message
- func (x *Event) Reset()
- func (x *Event) String() string
- type Geolocation
- func (*Geolocation) Descriptor() ([]byte, []int)deprecated
- func (x *Geolocation) GetAccuracy() int32
- func (x *Geolocation) GetAsn() int64
- func (x *Geolocation) GetAso() string
- func (x *Geolocation) GetCity() string
- func (x *Geolocation) GetCountry() string
- func (x *Geolocation) GetCountryCode() string
- func (x *Geolocation) GetLatitude() float64
- func (x *Geolocation) GetLongitude() float64
- func (*Geolocation) ProtoMessage()
- func (x *Geolocation) ProtoReflect() protoreflect.Message
- func (x *Geolocation) Reset()
- func (x *Geolocation) String() string
- type Grok
- type Impact
- func (*Impact) Descriptor() ([]byte, []int)deprecated
- func (x *Impact) GetAvailability() int32
- func (x *Impact) GetConfidentiality() int32
- func (x *Impact) GetIntegrity() int32
- func (*Impact) ProtoMessage()
- func (x *Impact) ProtoReflect() protoreflect.Message
- func (x *Impact) Reset()
- func (x *Impact) String() string
- type IntegrationClient
- type IntegrationFailureMessage
- type IntegrationServer
- type Integration_ProcessLogClient
- type Integration_ProcessLogServer
- type JLog
- type Json
- type Kv
- func (*Kv) Descriptor() ([]byte, []int)deprecated
- func (x *Kv) GetFieldSplit() string
- func (x *Kv) GetSource() string
- func (x *Kv) GetValueSplit() string
- func (x *Kv) GetWhere() *Where
- func (*Kv) ProtoMessage()
- func (x *Kv) ProtoReflect() protoreflect.Message
- func (x *Kv) Reset()
- func (x *Kv) String() string
- type ListValue
- type Log
- func (*Log) Descriptor() ([]byte, []int)deprecated
- func (x *Log) GetDataSource() string
- func (x *Log) GetDataType() string
- func (x *Log) GetId() string
- func (x *Log) GetRaw() string
- func (x *Log) GetTenantId() string
- func (x *Log) GetTimestamp() string
- func (*Log) ProtoMessage()
- func (x *Log) ProtoReflect() protoreflect.Message
- func (x *Log) Reset()
- func (x *Log) String() string
- type Message
- func (*Message) Descriptor() ([]byte, []int)deprecated
- func (x *Message) GetId() string
- func (x *Message) GetMessage() string
- func (x *Message) GetTimestamp() string
- func (x *Message) GetTopic() string
- func (*Message) ProtoMessage()
- func (x *Message) ProtoReflect() protoreflect.Message
- func (x *Message) Reset()
- func (x *Message) String() string
- type NotificationClient
- type NotificationServer
- type NullValue
- type ParsingClient
- type ParsingServer
- type Pattern
- type Pipeline
- type Reformat
- func (*Reformat) Descriptor() ([]byte, []int)deprecated
- func (x *Reformat) GetFields() []string
- func (x *Reformat) GetFromFormat() string
- func (x *Reformat) GetFunction() string
- func (x *Reformat) GetToFormat() string
- func (x *Reformat) GetWhere() *Where
- func (*Reformat) ProtoMessage()
- func (x *Reformat) ProtoReflect() protoreflect.Message
- func (x *Reformat) Reset()
- func (x *Reformat) String() string
- type Rename
- type Side
- func (*Side) Descriptor() ([]byte, []int)deprecated
- func (x *Side) GetBytesReceived() float64
- func (x *Side) GetBytesSent() float64
- func (x *Side) GetConnections() int64
- func (x *Side) GetDomain() string
- func (x *Side) GetEmail() string
- func (x *Side) GetFile() string
- func (x *Side) GetFqdn() string
- func (x *Side) GetGeolocation() *Geolocation
- func (x *Side) GetGroup() string
- func (x *Side) GetHash() string
- func (x *Side) GetHost() string
- func (x *Side) GetIp() string
- func (x *Side) GetMac() string
- func (x *Side) GetPackagesReceived() int64
- func (x *Side) GetPackagesSent() int64
- func (x *Side) GetPath() string
- func (x *Side) GetPort() int64
- func (x *Side) GetProcess() string
- func (x *Side) GetTotalCpuUnits() int64
- func (x *Side) GetTotalMem() int64
- func (x *Side) GetUrl() string
- func (x *Side) GetUsedCpuPercent() int64
- func (x *Side) GetUsedMemPercent() int64
- func (x *Side) GetUser() string
- func (*Side) ProtoMessage()
- func (x *Side) ProtoReflect() protoreflect.Message
- func (x *Side) Reset()
- func (x *Side) String() string
- type Step
- func (*Step) Descriptor() ([]byte, []int)deprecated
- func (x *Step) GetAdd() *Add
- func (x *Step) GetCast() *Cast
- func (x *Step) GetCsv() *Csv
- func (x *Step) GetDelete() *Delete
- func (x *Step) GetDrop() *Drop
- func (x *Step) GetDynamic() *Dynamic
- func (x *Step) GetGrok() *Grok
- func (x *Step) GetJson() *Json
- func (x *Step) GetKv() *Kv
- func (x *Step) GetReformat() *Reformat
- func (x *Step) GetRename() *Rename
- func (x *Step) GetTrim() *Trim
- func (*Step) ProtoMessage()
- func (x *Step) ProtoReflect() protoreflect.Message
- func (x *Step) Reset()
- func (x *Step) String() string
- type Struct
- type Tenant
- func (*Tenant) Descriptor() ([]byte, []int)deprecated
- func (x *Tenant) GetAssets() []*Asset
- func (x *Tenant) GetDisabledRules() []int64
- func (x *Tenant) GetId() string
- func (x *Tenant) GetName() string
- func (*Tenant) ProtoMessage()
- func (x *Tenant) ProtoReflect() protoreflect.Message
- func (x *Tenant) Reset()
- func (x *Tenant) String() string
- type Topic
- type Transform
- type Trim
- func (*Trim) Descriptor() ([]byte, []int)deprecated
- func (x *Trim) GetFields() []string
- func (x *Trim) GetFunction() string
- func (x *Trim) GetSubstring() string
- func (x *Trim) GetWhere() *Where
- func (*Trim) ProtoMessage()
- func (x *Trim) ProtoReflect() protoreflect.Message
- func (x *Trim) Reset()
- func (x *Trim) String() string
- type UnimplementedAnalysisServer
- type UnimplementedCorrelationServer
- type UnimplementedEngineServer
- type UnimplementedIntegrationServer
- type UnimplementedNotificationServer
- type UnimplementedParsingServer
- type UnsafeAnalysisServer
- type UnsafeCorrelationServer
- type UnsafeEngineServer
- type UnsafeIntegrationServer
- type UnsafeNotificationServer
- type UnsafeParsingServer
- type Value
- type Value_BoolValue
- type Value_ListValue
- type Value_NullValue
- type Value_NumberValue
- type Value_StringValue
- type Value_StructValue
- type Variable
- func (*Variable) Descriptor() ([]byte, []int)deprecated
- func (x *Variable) GetAs() string
- func (x *Variable) GetGet() string
- func (x *Variable) GetOfType() string
- func (*Variable) ProtoMessage()
- func (x *Variable) ProtoReflect() protoreflect.Message
- func (x *Variable) Reset()
- func (x *Variable) String() string
- type Where
- func (*Where) Descriptor() ([]byte, []int)deprecated
- func (def *Where) Evaluate(event *string) (bool, error)
- func (x *Where) GetExpression() string
- func (x *Where) GetVariables() []*Variable
- func (*Where) ProtoMessage()
- func (x *Where) ProtoReflect() protoreflect.Message
- func (x *Where) Reset()
- func (x *Where) String() string
Constants ¶
const ( Engine_Input_FullMethodName = "/gosdk.Engine/Input" Engine_Notify_FullMethodName = "/gosdk.Engine/Notify" )
const (
Analysis_Analyze_FullMethodName = "/gosdk.Analysis/Analyze"
)
const (
Correlation_Correlate_FullMethodName = "/gosdk.Correlation/Correlate"
)
const (
Integration_ProcessLog_FullMethodName = "/gosdk.Integration/ProcessLog"
)
const (
Notification_Notify_FullMethodName = "/gosdk.Notification/Notify"
)
const NullValue_NULL_VALUE = structpb.NullValue_NULL_VALUE
const (
Parsing_ParseLog_FullMethodName = "/gosdk.Parsing/ParseLog"
)
Variables ¶
var Analysis_ServiceDesc = grpc.ServiceDesc{ ServiceName: "gosdk.Analysis", HandlerType: (*AnalysisServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Analyze", Handler: _Analysis_Analyze_Handler, ServerStreams: true, }, }, Metadata: "plugins.proto", }
Analysis_ServiceDesc is the grpc.ServiceDesc for Analysis service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var Correlation_ServiceDesc = grpc.ServiceDesc{ ServiceName: "gosdk.Correlation", HandlerType: (*CorrelationServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Correlate", Handler: _Correlation_Correlate_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "plugins.proto", }
Correlation_ServiceDesc is the grpc.ServiceDesc for Correlation service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var Engine_ServiceDesc = grpc.ServiceDesc{ ServiceName: "gosdk.Engine", HandlerType: (*EngineServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Input", Handler: _Engine_Input_Handler, ServerStreams: true, ClientStreams: true, }, { StreamName: "Notify", Handler: _Engine_Notify_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "plugins.proto", }
Engine_ServiceDesc is the grpc.ServiceDesc for Engine service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_plugins_proto protoreflect.FileDescriptor
var Integration_ServiceDesc = grpc.ServiceDesc{ ServiceName: "gosdk.Integration", HandlerType: (*IntegrationServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "ProcessLog", Handler: _Integration_ProcessLog_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "plugins.proto", }
Integration_ServiceDesc is the grpc.ServiceDesc for Integration service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var Notification_ServiceDesc = grpc.ServiceDesc{ ServiceName: "gosdk.Notification", HandlerType: (*NotificationServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Notify", Handler: _Notification_Notify_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "plugins.proto", }
Notification_ServiceDesc is the grpc.ServiceDesc for Notification service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var NullValue_name = structpb.NullValue_name
var NullValue_value = structpb.NullValue_value
var Parsing_ServiceDesc = grpc.ServiceDesc{ ServiceName: "gosdk.Parsing", HandlerType: (*ParsingServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ParseLog", Handler: _Parsing_ParseLog_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "plugins.proto", }
Parsing_ServiceDesc is the grpc.ServiceDesc for Parsing service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func CastBool ¶ added in v0.9.0
func CastBool(value interface{}) bool
CastBool attempts to cast an interface{} to a bool. It supports the following types: - bool: returns the value directly. - int, int64, float64: returns true if the value is non-zero, false otherwise. - string: attempts to parse the string as a boolean using strconv.ParseBool. For any other type or if parsing fails, it returns false.
Parameters:
- value: The value to be cast to bool.
Returns:
- The bool representation of the value, or false if the value cannot be cast.
func CastFloat64 ¶ added in v0.9.0
func CastFloat64(value interface{}) float64
CastFloat64 attempts to cast an interface{} to a float64. It supports the following types: int, int64, float64, and string. If the value is a string, it tries to parse it as a float64. If the conversion is not possible, it returns 0.
Parameters:
- value: The value to be cast to float64.
Returns:
- The float64 representation of the value, or 0 if the value cannot be cast.
func CastInt64 ¶ added in v0.9.0
func CastInt64(value interface{}) int64
CastInt64 attempts to cast a given interface{} value to an int64. It supports the following types: int, int64, float64, and string. If the value is a string, it tries to parse it as an int64. If the value cannot be cast to int64, it returns 0.
Parameters:
- value: The value to be cast to int64.
Returns:
- The int64 representation of the value, or 0 if the value cannot be cast.
func CastString ¶ added in v0.9.0
func CastString(value interface{}) string
CastString attempts to cast an interface{} to a string. If the value is already a string, it returns the value directly. Otherwise, it converts the value to a string using fmt.Sprintf.
Parameters:
- value: The interface{} value to be cast to a string.
Returns:
- A string representation of the input value.
func DoReq ¶ added in v0.9.0
func DoReq[response any](url string, data []byte, method string, headers map[string]string) (response, int, *logger.Error)
DoReq sends an HTTP request and processes the response.
This function sends an HTTP request to the specified URL with the given method, data, and headers. It returns the response body unmarshalled into the specified response type, the HTTP status code, and an error if any occurred during the process.
Type Parameters:
- response: The type into which the response body will be unmarshalled.
Parameters:
- url: The URL to which the request is sent.
- data: The request payload as a byte slice.
- method: The HTTP method to use for the request (e.g., "GET", "POST").
- headers: A map of headers to include in the request.
Returns:
- response: The response body unmarshalled into the specified type.
- int: The HTTP status code of the response.
- *logger.Error: An error if any occurred during the request or response processing, otherwise nil.
func Download ¶ added in v0.9.0
Download downloads the content from the specified URL and saves it to the specified file. It returns a *logger.Error if any error occurs during the process.
Parameters:
- url: The URL from which to download the content.
- file: The path to the file where the content should be saved.
Returns:
- *logger.Error: An error object if an error occurs, otherwise nil.
func EnqueueNotification ¶ added in v0.11.2
EnqueueNotification sends a notification message to a specified topic. It marshals the NotificationMessage into JSON format and sends it to the notifications channel.
Parameters:
- topic: The topic to which the notification message will be sent.
- message: The notification message to be sent. Must be a JSON serializable object.
Returns:
- *logger.Error: Returns an error if the message marshalling fails, otherwise returns nil.
func GetCelType ¶ added in v0.9.0
GetCelType returns a pointer to a cel.Type based on the provided string type identifier. Supported type identifiers include: - "string": returns cel.StringType - "int": returns cel.IntType - "double": returns cel.DoubleType - "bool": returns cel.BoolType - "bytes": returns cel.BytesType - "uint": returns cel.UintType - "timestamp": returns cel.TimestampType - "duration": returns cel.DurationType - "type": returns cel.TypeType - "null": returns cel.NullType - "any": returns cel.AnyType - "[]string": returns cel.ListType(cel.StringType) - "[]int": returns cel.ListType(cel.IntType) - "[]double": returns cel.ListType(cel.DoubleType) - "[]bool": returns cel.ListType(cel.BoolType) - "[]bytes": returns cel.ListType(cel.BytesType) - "[]uint": returns cel.ListType(cel.UintType) - "[]timestamp": returns cel.ListType(cel.TimestampType) - "[]duration": returns cel.ListType(cel.DurationType) - "[]type": returns cel.ListType(cel.TypeType) - "[]null": returns cel.ListType(cel.NullType) - "[]any": returns cel.ListType(cel.AnyType) - "map[string]string": returns cel.MapType(cel.StringType, cel.StringType) - "map[string]int": returns cel.MapType(cel.StringType, cel.IntType) - "map[string]double": returns cel.MapType(cel.StringType, cel.DoubleType) - "map[string]bool": returns cel.MapType(cel.StringType, cel.BoolType) - "map[string]bytes": returns cel.MapType(cel.StringType, cel.BytesType) - "map[string]uint": returns cel.MapType(cel.StringType, cel.UintType) - "map[string]timestamp": returns cel.MapType(cel.StringType, cel.TimestampType) - "map[string]duration": returns cel.MapType(cel.StringType, cel.DurationType) - "map[string]type": returns cel.MapType(cel.StringType, cel.TypeType) - "map[string]null": returns cel.MapType(cel.StringType, cel.NullType) - "map[string]any": returns cel.MapType(cel.StringType, cel.AnyType) If the provided type identifier does not match any of the supported types, cel.AnyType is returned.
func GetMainIP ¶ added in v0.9.0
GetMainIP retrieves the main IP address of the local machine by establishing a UDP connection to a remote server (Google's public DNS server in this case). It returns the IP address as a string and a logger.Error if any error occurs during the process.
Returns:
- string: The main IP address of the local machine.
- *logger.Error: An error object if there is an issue obtaining the IP address.
func GetValueOf ¶ added in v0.9.0
GetValueOf returns the Go representation of a gjson.Result value. It converts the gjson.Result to the appropriate Go type based on its type: - For gjson.String, it returns a string. - For gjson.Number, it returns an int if the value is an integer, or a float if it contains a decimal point or a comma. - For gjson.True, it returns true. - For gjson.False, it returns false. - For gjson.JSON, it returns the raw JSON string. - For any other type, it returns an empty string.
func ListFiles ¶ added in v0.9.0
ListFiles walks through the directory specified by the route and returns a slice of file paths that match the given filter. The filter should be a file extension (e.g., ".txt").
Parameters:
- route: The root directory to start the file search.
- filter: The file extension to filter files by.
Returns:
- A slice of strings containing the paths of the files that match the filter.
If an error occurs during the file walk, it logs the error and panics if the error is not "no such file or directory".
func PluginCfg ¶ added in v0.9.0
PluginCfg retrieves the configuration for a specified plugin by name and unmarshals it into the provided type. The function returns a pointer to the configuration of the specified type and a pointer to a logger.Error if any error occurs.
Type Parameters:
t: The type into which the plugin configuration should be unmarshaled.
Parameters:
name: The name of the plugin whose configuration is to be retrieved.
Returns:
*t: A pointer to the configuration of the specified type. *logger.Error: A pointer to a logger.Error if any error occurs during the process, otherwise nil.
func PointerOf ¶ added in v0.10.1
func PointerOf[t any](s t) *t
PointerOf takes a value of any type and returns a pointer to that value. This is useful for creating pointers to literals or values that are not already pointers.
Example usage:
intValue := 42 intPointer := PointerOf(intValue)
Type Parameters:
t: The type of the value to be pointed to.
Parameters:
s: The value to create a pointer for.
Returns:
A pointer to the provided value.
func ReadCSV ¶ added in v0.9.0
ReadCSV reads a CSV file from the given URL and returns its contents as a slice of string slices. If an error occurs while opening or reading the file, it logs the error and returns nil.
Parameters:
- url: The path to the CSV file.
Returns:
- [][]string: The contents of the CSV file.
- *logger.Error: An error object if an error occurs, otherwise nil.
func ReadJSON ¶ added in v0.9.0
ReadJSON reads a JSON file and unmarshals its content into a specified type. The function takes a file path as input and returns a pointer to the unmarshaled value of the specified type and a pointer to a logger.Error if an error occurs.
Type Parameters:
t: The type into which the JSON content should be unmarshaled.
Parameters:
f: The file path of the JSON file to be read.
Returns:
*t: A pointer to the unmarshaled value of the specified type. *logger.Error: A pointer to a logger.Error if an error occurs, otherwise nil.
func ReadPbYaml ¶ added in v0.11.0
ReadPbYaml reads a YAML file, converts its content to JSON, and returns the JSON bytes. If an error occurs while reading the file or converting its content, it returns a logger.Error.
Parameters:
- f: The file path of the YAML file to be read.
Returns:
- []byte: The JSON bytes converted from the YAML file.
- *logger.Error: An error object if an error occurs, otherwise nil.
func ReadYaml ¶ added in v0.11.0
ReadYaml reads a YAML file and unmarshals its content into a specified type. The function can also handle JSON mode if specified.
Type Parameters:
t: The type into which the YAML content will be unmarshaled.
Parameters:
f: The file path to the YAML file. jsonMode: A boolean flag indicating whether to use JSON mode for unmarshaling.
Returns:
*t: A pointer to the unmarshaled content of type t. *logger.Error: A pointer to an error object if an error occurs, otherwise nil.
func RegisterAnalysisServer ¶ added in v0.9.0
func RegisterAnalysisServer(s grpc.ServiceRegistrar, srv AnalysisServer)
func RegisterCorrelationServer ¶ added in v0.9.0
func RegisterCorrelationServer(s grpc.ServiceRegistrar, srv CorrelationServer)
func RegisterEngineServer ¶ added in v0.9.0
func RegisterEngineServer(s grpc.ServiceRegistrar, srv EngineServer)
func RegisterIntegrationServer ¶ added in v0.9.0
func RegisterIntegrationServer(s grpc.ServiceRegistrar, srv IntegrationServer)
func RegisterNotificationServer ¶ added in v0.9.0
func RegisterNotificationServer(s grpc.ServiceRegistrar, srv NotificationServer)
func RegisterParsingServer ¶ added in v0.9.0
func RegisterParsingServer(s grpc.ServiceRegistrar, srv ParsingServer)
func SendNotificationsFromChannel ¶ added in v0.11.2
SendNotificationsFromChannel listens to the notificationsChannel and sends notifications to the engine server via gRPC. It logs errors if the connection to the engine server fails, if sending a notification fails, or if receiving an acknowledgment fails. It runs indefinitely and should be run as a goroutine.
Returns:
*logger.Error: An error object if any error occurs during the process.
func ToObject ¶ added in v0.9.0
func ToObject(str *string, object protoreflect.ProtoMessage) *logger.Error
ToObject unmarshals a JSON-encoded string into a given ProtoMessage object.
Parameters:
- str: A pointer to the JSON-encoded string.
- object: The ProtoMessage object to unmarshal the JSON string into.
Returns:
- *logger.Error: An error object if the unmarshalling fails, otherwise nil.
func ToString ¶ added in v0.9.0
func ToString(object protoreflect.ProtoMessage) (*string, *logger.Error)
ToString converts a given ProtoMessage object to its JSON string representation. It returns a pointer to the JSON string and a pointer to a logger.Error if any error occurs during marshaling.
Parameters:
- object: The ProtoMessage object to be converted.
Returns:
- *string: A pointer to the JSON string representation of the object.
- *logger.Error: A pointer to a logger.Error if an error occurs, otherwise nil.
Types ¶
type Ack ¶ added in v0.9.0
type Ack struct { LastId string `protobuf:"bytes,1,opt,name=lastId,proto3" json:"lastId,omitempty"` // contains filtered or unexported fields }
func (*Ack) Descriptor
deprecated
added in
v0.9.0
func (*Ack) ProtoMessage ¶ added in v0.9.0
func (*Ack) ProtoMessage()
func (*Ack) ProtoReflect ¶ added in v0.9.0
func (x *Ack) ProtoReflect() protoreflect.Message
type Add ¶ added in v0.9.0
type Add struct { Function string `protobuf:"bytes,1,opt,name=function,proto3" json:"function,omitempty"` Params map[string]*structpb.Value `` /* 153-byte string literal not displayed */ Where *Where `protobuf:"bytes,3,opt,name=where,proto3" json:"where,omitempty"` // contains filtered or unexported fields }
func (*Add) Descriptor
deprecated
added in
v0.9.0
func (*Add) GetFunction ¶ added in v0.9.0
func (*Add) ProtoMessage ¶ added in v0.9.0
func (*Add) ProtoMessage()
func (*Add) ProtoReflect ¶ added in v0.9.0
func (x *Add) ProtoReflect() protoreflect.Message
type Alert ¶
type Alert struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Timestamp string `protobuf:"bytes,2,opt,name=timestamp,json=@timestamp,proto3" json:"timestamp,omitempty"` LastUpdate string `protobuf:"bytes,3,opt,name=lastUpdate,proto3" json:"lastUpdate,omitempty"` Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` TenantId string `protobuf:"bytes,5,opt,name=tenantId,proto3" json:"tenantId,omitempty"` TenantName string `protobuf:"bytes,6,opt,name=tenantName,proto3" json:"tenantName,omitempty"` DataSource string `protobuf:"bytes,7,opt,name=dataSource,proto3" json:"dataSource,omitempty"` DataType string `protobuf:"bytes,8,opt,name=dataType,proto3" json:"dataType,omitempty"` Category string `protobuf:"bytes,9,opt,name=category,proto3" json:"category,omitempty"` Technique string `protobuf:"bytes,10,opt,name=technique,proto3" json:"technique,omitempty"` Description string `protobuf:"bytes,11,opt,name=description,proto3" json:"description,omitempty"` References []string `protobuf:"bytes,12,rep,name=references,proto3" json:"references,omitempty"` Impact *Impact `protobuf:"bytes,13,opt,name=impact,proto3" json:"impact,omitempty"` ImpactScore int32 `protobuf:"varint,14,opt,name=impactScore,proto3" json:"impactScore,omitempty"` Severity string `protobuf:"bytes,15,opt,name=severity,proto3" json:"severity,omitempty"` Adversary *Side `protobuf:"bytes,16,opt,name=adversary,proto3" json:"adversary,omitempty"` Target *Side `protobuf:"bytes,17,opt,name=target,proto3" json:"target,omitempty"` Events []string `protobuf:"bytes,18,rep,name=events,proto3" json:"events,omitempty"` // contains filtered or unexported fields }
func (*Alert) Descriptor
deprecated
added in
v0.9.0
func (*Alert) GetAdversary ¶ added in v0.9.0
func (*Alert) GetCategory ¶ added in v0.9.0
func (*Alert) GetDataSource ¶ added in v0.9.0
func (*Alert) GetDataType ¶ added in v0.9.0
func (*Alert) GetDescription ¶ added in v0.9.0
func (*Alert) GetImpactScore ¶ added in v0.9.0
func (*Alert) GetLastUpdate ¶ added in v0.9.0
func (*Alert) GetReferences ¶ added in v0.9.0
func (*Alert) GetSeverity ¶ added in v0.9.0
func (*Alert) GetTechnique ¶ added in v0.9.0
func (*Alert) GetTenantId ¶ added in v0.9.0
func (*Alert) GetTenantName ¶ added in v0.9.0
func (*Alert) GetTimestamp ¶ added in v0.9.0
func (*Alert) ProtoMessage ¶ added in v0.9.0
func (*Alert) ProtoMessage()
func (*Alert) ProtoReflect ¶ added in v0.9.0
func (x *Alert) ProtoReflect() protoreflect.Message
type AnalysisClient ¶ added in v0.9.0
type AnalysisClient interface {
Analyze(ctx context.Context, in *Event, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Alert], error)
}
AnalysisClient is the client API for Analysis service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewAnalysisClient ¶ added in v0.9.0
func NewAnalysisClient(cc grpc.ClientConnInterface) AnalysisClient
type AnalysisServer ¶ added in v0.9.0
type AnalysisServer interface { Analyze(*Event, grpc.ServerStreamingServer[Alert]) error // contains filtered or unexported methods }
AnalysisServer is the server API for Analysis service. All implementations must embed UnimplementedAnalysisServer for forward compatibility.
type Analysis_AnalyzeClient ¶ added in v0.10.2
type Analysis_AnalyzeClient = grpc.ServerStreamingClient[Alert]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Analysis_AnalyzeServer ¶ added in v0.10.2
type Analysis_AnalyzeServer = grpc.ServerStreamingServer[Alert]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Asset ¶ added in v0.9.0
type Asset struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Hostnames []string `protobuf:"bytes,2,rep,name=hostnames,proto3" json:"hostnames,omitempty"` Ips []string `protobuf:"bytes,3,rep,name=ips,proto3" json:"ips,omitempty"` Confidentiality int32 `protobuf:"varint,4,opt,name=confidentiality,proto3" json:"confidentiality,omitempty"` Availability int32 `protobuf:"varint,5,opt,name=availability,proto3" json:"availability,omitempty"` Integrity int32 `protobuf:"varint,6,opt,name=integrity,proto3" json:"integrity,omitempty"` // contains filtered or unexported fields }
func (*Asset) Descriptor
deprecated
added in
v0.11.0
func (*Asset) GetAvailability ¶ added in v0.11.0
func (*Asset) GetConfidentiality ¶ added in v0.11.0
func (*Asset) GetHostnames ¶ added in v0.11.0
func (*Asset) GetIntegrity ¶ added in v0.11.0
func (*Asset) ProtoMessage ¶ added in v0.11.0
func (*Asset) ProtoMessage()
func (*Asset) ProtoReflect ¶ added in v0.11.0
func (x *Asset) ProtoReflect() protoreflect.Message
type Cast ¶ added in v0.9.0
type Cast struct { To string `protobuf:"bytes,1,opt,name=to,proto3" json:"to,omitempty"` Fields []string `protobuf:"bytes,2,rep,name=fields,proto3" json:"fields,omitempty"` Where *Where `protobuf:"bytes,3,opt,name=where,proto3" json:"where,omitempty"` // contains filtered or unexported fields }
func (*Cast) Descriptor
deprecated
added in
v0.9.0
func (*Cast) ProtoMessage ¶ added in v0.9.0
func (*Cast) ProtoMessage()
func (*Cast) ProtoReflect ¶ added in v0.9.0
func (x *Cast) ProtoReflect() protoreflect.Message
type Config ¶ added in v0.9.0
type Config struct { Pipeline []*Pipeline `protobuf:"bytes,1,rep,name=pipeline,proto3" json:"pipeline,omitempty"` DisabledRules []int64 `protobuf:"varint,2,rep,packed,name=disabledRules,proto3" json:"disabledRules,omitempty"` Tenants []*Tenant `protobuf:"bytes,3,rep,name=tenants,proto3" json:"tenants,omitempty"` Patterns map[string]string `` /* 157-byte string literal not displayed */ Plugins map[string]*structpb.Value `` /* 155-byte string literal not displayed */ Env *Env `protobuf:"bytes,6,opt,name=env,proto3" json:"env,omitempty"` // contains filtered or unexported fields }
func GetCfg ¶ added in v0.9.0
func GetCfg() *Config
GetCfg initializes the configuration if it hasn't been initialized yet, and starts a goroutine to periodically update the configuration every 60 seconds. It waits for the initial configuration to be set before returning it. The function returns a pointer to the Config struct.
func (*Config) Descriptor
deprecated
added in
v0.11.0
func (*Config) GetDisabledRules ¶ added in v0.11.0
func (*Config) GetPatterns ¶ added in v0.11.0
func (*Config) GetPipeline ¶ added in v0.11.0
func (*Config) GetPlugins ¶ added in v0.11.0
func (*Config) GetTenants ¶ added in v0.11.0
func (*Config) ProtoMessage ¶ added in v0.11.0
func (*Config) ProtoMessage()
func (*Config) ProtoReflect ¶ added in v0.11.0
func (x *Config) ProtoReflect() protoreflect.Message
type CorrelationClient ¶ added in v0.9.0
type CorrelationClient interface {
Correlate(ctx context.Context, in *Alert, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
CorrelationClient is the client API for Correlation service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewCorrelationClient ¶ added in v0.9.0
func NewCorrelationClient(cc grpc.ClientConnInterface) CorrelationClient
type CorrelationServer ¶ added in v0.9.0
type CorrelationServer interface { Correlate(context.Context, *Alert) (*emptypb.Empty, error) // contains filtered or unexported methods }
CorrelationServer is the server API for Correlation service. All implementations must embed UnimplementedCorrelationServer for forward compatibility.
type Csv ¶ added in v0.9.0
type Csv struct { Source string `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"` Separator string `protobuf:"bytes,2,opt,name=separator,proto3" json:"separator,omitempty"` Headers []string `protobuf:"bytes,3,rep,name=headers,proto3" json:"headers,omitempty"` Where *Where `protobuf:"bytes,4,opt,name=where,proto3" json:"where,omitempty"` // contains filtered or unexported fields }
func (*Csv) Descriptor
deprecated
added in
v0.9.0
func (*Csv) GetHeaders ¶ added in v0.9.0
func (*Csv) GetSeparator ¶ added in v0.9.0
func (*Csv) ProtoMessage ¶ added in v0.9.0
func (*Csv) ProtoMessage()
func (*Csv) ProtoReflect ¶ added in v0.9.0
func (x *Csv) ProtoReflect() protoreflect.Message
type DataProcessingMessage ¶ added in v0.11.4
type DataProcessingMessage struct { Cause *string `json:"cause,omitempty"` DataType string `json:"dataType"` DataSource string `json:"dataSource"` }
Represent the details of a success or failure during the processing of a log. Used as a message body for notifications.
type Delete ¶ added in v0.9.0
type Delete struct { Fields []string `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty"` Where *Where `protobuf:"bytes,2,opt,name=where,proto3" json:"where,omitempty"` // contains filtered or unexported fields }
func (*Delete) Descriptor
deprecated
added in
v0.9.0
func (*Delete) ProtoMessage ¶ added in v0.9.0
func (*Delete) ProtoMessage()
func (*Delete) ProtoReflect ¶ added in v0.9.0
func (x *Delete) ProtoReflect() protoreflect.Message
type Drop ¶ added in v0.9.0
type Drop struct { Where *Where `protobuf:"bytes,1,opt,name=where,proto3" json:"where,omitempty"` // contains filtered or unexported fields }
func (*Drop) Descriptor
deprecated
added in
v0.9.0
func (*Drop) ProtoMessage ¶ added in v0.9.0
func (*Drop) ProtoMessage()
func (*Drop) ProtoReflect ¶ added in v0.9.0
func (x *Drop) ProtoReflect() protoreflect.Message
type Dynamic ¶ added in v0.9.0
type Dynamic struct { Plugin string `protobuf:"bytes,1,opt,name=plugin,proto3" json:"plugin,omitempty"` Params map[string]*structpb.Value `` /* 153-byte string literal not displayed */ Where *Where `protobuf:"bytes,3,opt,name=where,proto3" json:"where,omitempty"` // contains filtered or unexported fields }
func (*Dynamic) Descriptor
deprecated
added in
v0.9.0
func (*Dynamic) ProtoMessage ¶ added in v0.9.0
func (*Dynamic) ProtoMessage()
func (*Dynamic) ProtoReflect ¶ added in v0.9.0
func (x *Dynamic) ProtoReflect() protoreflect.Message
type EngineClient ¶ added in v0.9.0
type EngineClient interface { Input(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[Log, Ack], error) Notify(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[Message, Ack], error) }
EngineClient is the client API for Engine service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewEngineClient ¶ added in v0.9.0
func NewEngineClient(cc grpc.ClientConnInterface) EngineClient
type EngineServer ¶ added in v0.9.0
type EngineServer interface { Input(grpc.BidiStreamingServer[Log, Ack]) error Notify(grpc.BidiStreamingServer[Message, Ack]) error // contains filtered or unexported methods }
EngineServer is the server API for Engine service. All implementations must embed UnimplementedEngineServer for forward compatibility.
type Engine_InputClient ¶ added in v0.9.0
type Engine_InputClient = grpc.BidiStreamingClient[Log, Ack]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Engine_InputServer ¶ added in v0.9.0
type Engine_InputServer = grpc.BidiStreamingServer[Log, Ack]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Engine_NotifyClient ¶ added in v0.9.0
type Engine_NotifyClient = grpc.BidiStreamingClient[Message, Ack]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Engine_NotifyServer ¶ added in v0.9.0
type Engine_NotifyServer = grpc.BidiStreamingServer[Message, Ack]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Env ¶ added in v0.9.0
type Env struct { NodeName string `protobuf:"bytes,1,opt,name=nodeName,proto3" json:"nodeName,omitempty"` NodeGroups []string `protobuf:"bytes,2,rep,name=nodeGroups,proto3" json:"nodeGroups,omitempty"` Workdir string `protobuf:"bytes,3,opt,name=workdir,proto3" json:"workdir,omitempty"` LogLevel int64 `protobuf:"varint,4,opt,name=logLevel,proto3" json:"logLevel,omitempty"` // contains filtered or unexported fields }
func (*Env) Descriptor
deprecated
added in
v0.11.0
func (*Env) GetLogLevel ¶ added in v0.11.0
func (*Env) GetNodeGroups ¶ added in v0.11.0
func (*Env) GetNodeName ¶ added in v0.11.0
func (*Env) GetWorkdir ¶ added in v0.11.0
func (*Env) ProtoMessage ¶ added in v0.11.0
func (*Env) ProtoMessage()
func (*Env) ProtoReflect ¶ added in v0.11.0
func (x *Env) ProtoReflect() protoreflect.Message
type Event ¶
type Event struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Timestamp string `protobuf:"bytes,2,opt,name=timestamp,json=@timestamp,proto3" json:"timestamp,omitempty"` DeviceTime string `protobuf:"bytes,3,opt,name=deviceTime,proto3" json:"deviceTime,omitempty"` DataType string `protobuf:"bytes,4,opt,name=dataType,proto3" json:"dataType,omitempty"` DataSource string `protobuf:"bytes,5,opt,name=dataSource,proto3" json:"dataSource,omitempty"` TenantId string `protobuf:"bytes,6,opt,name=tenantId,proto3" json:"tenantId,omitempty"` TenantName string `protobuf:"bytes,7,opt,name=tenantName,proto3" json:"tenantName,omitempty"` Raw string `protobuf:"bytes,8,opt,name=raw,proto3" json:"raw,omitempty"` Log map[string]*structpb.Value `` /* 147-byte string literal not displayed */ Target *Side `protobuf:"bytes,10,opt,name=target,proto3" json:"target,omitempty"` Origin *Side `protobuf:"bytes,11,opt,name=origin,proto3" json:"origin,omitempty"` Protocol string `protobuf:"bytes,12,opt,name=protocol,proto3" json:"protocol,omitempty"` ConnectionStatus string `protobuf:"bytes,13,opt,name=connectionStatus,proto3" json:"connectionStatus,omitempty"` StatusCode int64 `protobuf:"varint,14,opt,name=statusCode,proto3" json:"statusCode,omitempty"` ActionResult string `protobuf:"bytes,15,opt,name=actionResult,proto3" json:"actionResult,omitempty"` Action string `protobuf:"bytes,16,opt,name=action,proto3" json:"action,omitempty"` Command string `protobuf:"bytes,17,opt,name=command,proto3" json:"command,omitempty"` // contains filtered or unexported fields }
func (*Event) Descriptor
deprecated
added in
v0.9.0
func (*Event) GetActionResult ¶ added in v0.9.0
func (*Event) GetCommand ¶ added in v0.11.14
func (*Event) GetConnectionStatus ¶ added in v0.9.0
func (*Event) GetDataSource ¶ added in v0.9.0
func (*Event) GetDataType ¶ added in v0.9.0
func (*Event) GetDeviceTime ¶ added in v0.9.0
func (*Event) GetProtocol ¶ added in v0.9.0
func (*Event) GetStatusCode ¶ added in v0.9.0
func (*Event) GetTenantId ¶ added in v0.9.0
func (*Event) GetTenantName ¶ added in v0.9.0
func (*Event) GetTimestamp ¶ added in v0.9.0
func (*Event) ProtoMessage ¶ added in v0.9.0
func (*Event) ProtoMessage()
func (*Event) ProtoReflect ¶ added in v0.9.0
func (x *Event) ProtoReflect() protoreflect.Message
type Geolocation ¶
type Geolocation struct { Country string `protobuf:"bytes,1,opt,name=country,proto3" json:"country,omitempty"` City string `protobuf:"bytes,2,opt,name=city,proto3" json:"city,omitempty"` Latitude float64 `protobuf:"fixed64,3,opt,name=latitude,proto3" json:"latitude,omitempty"` Longitude float64 `protobuf:"fixed64,4,opt,name=longitude,proto3" json:"longitude,omitempty"` Asn int64 `protobuf:"varint,5,opt,name=asn,proto3" json:"asn,omitempty"` Aso string `protobuf:"bytes,6,opt,name=aso,proto3" json:"aso,omitempty"` CountryCode string `protobuf:"bytes,7,opt,name=countryCode,proto3" json:"countryCode,omitempty"` Accuracy int32 `protobuf:"varint,8,opt,name=accuracy,proto3" json:"accuracy,omitempty"` // contains filtered or unexported fields }
func (*Geolocation) Descriptor
deprecated
added in
v0.9.0
func (*Geolocation) Descriptor() ([]byte, []int)
Deprecated: Use Geolocation.ProtoReflect.Descriptor instead.
func (*Geolocation) GetAccuracy ¶ added in v0.9.0
func (x *Geolocation) GetAccuracy() int32
func (*Geolocation) GetAsn ¶ added in v0.9.0
func (x *Geolocation) GetAsn() int64
func (*Geolocation) GetAso ¶ added in v0.9.0
func (x *Geolocation) GetAso() string
func (*Geolocation) GetCity ¶ added in v0.9.0
func (x *Geolocation) GetCity() string
func (*Geolocation) GetCountry ¶ added in v0.9.0
func (x *Geolocation) GetCountry() string
func (*Geolocation) GetCountryCode ¶ added in v0.9.0
func (x *Geolocation) GetCountryCode() string
func (*Geolocation) GetLatitude ¶ added in v0.9.0
func (x *Geolocation) GetLatitude() float64
func (*Geolocation) GetLongitude ¶ added in v0.9.0
func (x *Geolocation) GetLongitude() float64
func (*Geolocation) ProtoMessage ¶ added in v0.9.0
func (*Geolocation) ProtoMessage()
func (*Geolocation) ProtoReflect ¶ added in v0.9.0
func (x *Geolocation) ProtoReflect() protoreflect.Message
func (*Geolocation) Reset ¶ added in v0.9.0
func (x *Geolocation) Reset()
func (*Geolocation) String ¶ added in v0.9.0
func (x *Geolocation) String() string
type Grok ¶ added in v0.9.0
type Grok struct { Patterns []*Pattern `protobuf:"bytes,1,rep,name=patterns,proto3" json:"patterns,omitempty"` Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` Where *Where `protobuf:"bytes,3,opt,name=where,proto3" json:"where,omitempty"` // contains filtered or unexported fields }
func (*Grok) Descriptor
deprecated
added in
v0.9.0
func (*Grok) GetPatterns ¶ added in v0.9.0
func (*Grok) ProtoMessage ¶ added in v0.9.0
func (*Grok) ProtoMessage()
func (*Grok) ProtoReflect ¶ added in v0.9.0
func (x *Grok) ProtoReflect() protoreflect.Message
type Impact ¶
type Impact struct { Confidentiality int32 `protobuf:"varint,1,opt,name=confidentiality,proto3" json:"confidentiality,omitempty"` Integrity int32 `protobuf:"varint,2,opt,name=integrity,proto3" json:"integrity,omitempty"` Availability int32 `protobuf:"varint,3,opt,name=availability,proto3" json:"availability,omitempty"` // contains filtered or unexported fields }
func (*Impact) Descriptor
deprecated
added in
v0.9.0
func (*Impact) GetAvailability ¶ added in v0.9.0
func (*Impact) GetConfidentiality ¶ added in v0.9.0
func (*Impact) GetIntegrity ¶ added in v0.9.0
func (*Impact) ProtoMessage ¶ added in v0.9.0
func (*Impact) ProtoMessage()
func (*Impact) ProtoReflect ¶ added in v0.9.0
func (x *Impact) ProtoReflect() protoreflect.Message
type IntegrationClient ¶ added in v0.9.0
type IntegrationClient interface {
ProcessLog(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[Log, Ack], error)
}
IntegrationClient is the client API for Integration service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewIntegrationClient ¶ added in v0.9.0
func NewIntegrationClient(cc grpc.ClientConnInterface) IntegrationClient
type IntegrationFailureMessage ¶ added in v0.11.4
type IntegrationFailureMessage struct { Cause string `json:"cause"` IntegrationName string `json:"integrationName"` Tenant *string `json:"tenant,omitempty"` }
Represents a notification message to be sent to the backend in the event of a failure in an integration.
type IntegrationServer ¶ added in v0.9.0
type IntegrationServer interface { ProcessLog(grpc.BidiStreamingServer[Log, Ack]) error // contains filtered or unexported methods }
IntegrationServer is the server API for Integration service. All implementations must embed UnimplementedIntegrationServer for forward compatibility.
type Integration_ProcessLogClient ¶ added in v0.9.0
type Integration_ProcessLogClient = grpc.BidiStreamingClient[Log, Ack]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Integration_ProcessLogServer ¶ added in v0.9.0
type Integration_ProcessLogServer = grpc.BidiStreamingServer[Log, Ack]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type JLog ¶ added in v0.9.0
type JLog struct { Log string `protobuf:"bytes,1,opt,name=Log,proto3" json:"Log,omitempty"` // contains filtered or unexported fields }
func (*JLog) Descriptor
deprecated
added in
v0.9.0
func (*JLog) ProtoMessage ¶ added in v0.9.0
func (*JLog) ProtoMessage()
func (*JLog) ProtoReflect ¶ added in v0.9.0
func (x *JLog) ProtoReflect() protoreflect.Message
type Json ¶ added in v0.9.0
type Json struct { Source string `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"` Where *Where `protobuf:"bytes,2,opt,name=where,proto3" json:"where,omitempty"` // contains filtered or unexported fields }
func (*Json) Descriptor
deprecated
added in
v0.9.0
func (*Json) ProtoMessage ¶ added in v0.9.0
func (*Json) ProtoMessage()
func (*Json) ProtoReflect ¶ added in v0.9.0
func (x *Json) ProtoReflect() protoreflect.Message
type Kv ¶ added in v0.9.0
type Kv struct { FieldSplit string `protobuf:"bytes,1,opt,name=fieldSplit,proto3" json:"fieldSplit,omitempty"` ValueSplit string `protobuf:"bytes,2,opt,name=valueSplit,proto3" json:"valueSplit,omitempty"` Source string `protobuf:"bytes,3,opt,name=source,proto3" json:"source,omitempty"` Where *Where `protobuf:"bytes,4,opt,name=where,proto3" json:"where,omitempty"` // contains filtered or unexported fields }
func (*Kv) Descriptor
deprecated
added in
v0.9.0
func (*Kv) GetFieldSplit ¶ added in v0.9.0
func (*Kv) GetValueSplit ¶ added in v0.9.0
func (*Kv) ProtoMessage ¶ added in v0.9.0
func (*Kv) ProtoMessage()
func (*Kv) ProtoReflect ¶ added in v0.9.0
func (x *Kv) ProtoReflect() protoreflect.Message
type Log ¶ added in v0.9.0
type Log struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` DataType string `protobuf:"bytes,2,opt,name=dataType,proto3" json:"dataType,omitempty"` DataSource string `protobuf:"bytes,3,opt,name=dataSource,proto3" json:"dataSource,omitempty"` Timestamp string `protobuf:"bytes,4,opt,name=timestamp,json=@timestamp,proto3" json:"timestamp,omitempty"` TenantId string `protobuf:"bytes,5,opt,name=tenantId,proto3" json:"tenantId,omitempty"` Raw string `protobuf:"bytes,6,opt,name=raw,proto3" json:"raw,omitempty"` // contains filtered or unexported fields }
func (*Log) Descriptor
deprecated
added in
v0.9.0
func (*Log) GetDataSource ¶ added in v0.9.0
func (*Log) GetDataType ¶ added in v0.9.0
func (*Log) GetTenantId ¶ added in v0.9.0
func (*Log) GetTimestamp ¶ added in v0.9.0
func (*Log) ProtoMessage ¶ added in v0.9.0
func (*Log) ProtoMessage()
func (*Log) ProtoReflect ¶ added in v0.9.0
func (x *Log) ProtoReflect() protoreflect.Message
type Message ¶ added in v0.9.0
type Message struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Timestamp string `protobuf:"bytes,2,opt,name=timestamp,json=@timestamp,proto3" json:"timestamp,omitempty"` Topic string `protobuf:"bytes,3,opt,name=topic,proto3" json:"topic,omitempty"` Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*Message) Descriptor
deprecated
added in
v0.9.0
func (*Message) GetMessage ¶ added in v0.9.0
func (*Message) GetTimestamp ¶ added in v0.9.0
func (*Message) ProtoMessage ¶ added in v0.9.0
func (*Message) ProtoMessage()
func (*Message) ProtoReflect ¶ added in v0.9.0
func (x *Message) ProtoReflect() protoreflect.Message
type NotificationClient ¶ added in v0.9.0
type NotificationClient interface {
Notify(ctx context.Context, in *Message, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
NotificationClient is the client API for Notification service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewNotificationClient ¶ added in v0.9.0
func NewNotificationClient(cc grpc.ClientConnInterface) NotificationClient
type NotificationServer ¶ added in v0.9.0
type NotificationServer interface { Notify(context.Context, *Message) (*emptypb.Empty, error) // contains filtered or unexported methods }
NotificationServer is the server API for Notification service. All implementations must embed UnimplementedNotificationServer for forward compatibility.
type ParsingClient ¶ added in v0.9.0
type ParsingClient interface {
ParseLog(ctx context.Context, in *Transform, opts ...grpc.CallOption) (*JLog, error)
}
ParsingClient is the client API for Parsing service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewParsingClient ¶ added in v0.9.0
func NewParsingClient(cc grpc.ClientConnInterface) ParsingClient
type ParsingServer ¶ added in v0.9.0
type ParsingServer interface { ParseLog(context.Context, *Transform) (*JLog, error) // contains filtered or unexported methods }
ParsingServer is the server API for Parsing service. All implementations must embed UnimplementedParsingServer for forward compatibility.
type Pattern ¶ added in v0.9.0
type Pattern struct { FieldName string `protobuf:"bytes,1,opt,name=fieldName,proto3" json:"fieldName,omitempty"` Pattern string `protobuf:"bytes,2,opt,name=pattern,proto3" json:"pattern,omitempty"` // contains filtered or unexported fields }
func (*Pattern) Descriptor
deprecated
added in
v0.9.0
func (*Pattern) GetFieldName ¶ added in v0.9.0
func (*Pattern) GetPattern ¶ added in v0.9.0
func (*Pattern) ProtoMessage ¶ added in v0.9.0
func (*Pattern) ProtoMessage()
func (*Pattern) ProtoReflect ¶ added in v0.9.0
func (x *Pattern) ProtoReflect() protoreflect.Message
type Pipeline ¶ added in v0.9.0
type Pipeline struct { DataTypes []string `protobuf:"bytes,1,rep,name=dataTypes,proto3" json:"dataTypes,omitempty"` Steps []*Step `protobuf:"bytes,2,rep,name=steps,proto3" json:"steps,omitempty"` // contains filtered or unexported fields }
func (*Pipeline) Descriptor
deprecated
added in
v0.11.0
func (*Pipeline) GetDataTypes ¶ added in v0.11.0
func (*Pipeline) ProtoMessage ¶ added in v0.11.0
func (*Pipeline) ProtoMessage()
func (*Pipeline) ProtoReflect ¶ added in v0.11.0
func (x *Pipeline) ProtoReflect() protoreflect.Message
type Reformat ¶ added in v0.9.0
type Reformat struct { Fields []string `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty"` Function string `protobuf:"bytes,2,opt,name=function,proto3" json:"function,omitempty"` FromFormat string `protobuf:"bytes,3,opt,name=fromFormat,proto3" json:"fromFormat,omitempty"` ToFormat string `protobuf:"bytes,4,opt,name=toFormat,proto3" json:"toFormat,omitempty"` Where *Where `protobuf:"bytes,5,opt,name=where,proto3" json:"where,omitempty"` // contains filtered or unexported fields }
func (*Reformat) Descriptor
deprecated
added in
v0.9.0
func (*Reformat) GetFromFormat ¶ added in v0.9.0
func (*Reformat) GetFunction ¶ added in v0.9.0
func (*Reformat) GetToFormat ¶ added in v0.9.0
func (*Reformat) ProtoMessage ¶ added in v0.9.0
func (*Reformat) ProtoMessage()
func (*Reformat) ProtoReflect ¶ added in v0.9.0
func (x *Reformat) ProtoReflect() protoreflect.Message
type Rename ¶ added in v0.9.0
type Rename struct { To string `protobuf:"bytes,1,opt,name=to,proto3" json:"to,omitempty"` From []string `protobuf:"bytes,2,rep,name=from,proto3" json:"from,omitempty"` Where *Where `protobuf:"bytes,3,opt,name=where,proto3" json:"where,omitempty"` // contains filtered or unexported fields }
func (*Rename) Descriptor
deprecated
added in
v0.9.0
func (*Rename) ProtoMessage ¶ added in v0.9.0
func (*Rename) ProtoMessage()
func (*Rename) ProtoReflect ¶ added in v0.9.0
func (x *Rename) ProtoReflect() protoreflect.Message
type Side ¶
type Side struct { BytesSent float64 `protobuf:"fixed64,1,opt,name=bytesSent,proto3" json:"bytesSent,omitempty"` BytesReceived float64 `protobuf:"fixed64,2,opt,name=bytesReceived,proto3" json:"bytesReceived,omitempty"` PackagesSent int64 `protobuf:"varint,3,opt,name=packagesSent,proto3" json:"packagesSent,omitempty"` PackagesReceived int64 `protobuf:"varint,4,opt,name=packagesReceived,proto3" json:"packagesReceived,omitempty"` Connections int64 `protobuf:"varint,5,opt,name=connections,proto3" json:"connections,omitempty"` UsedCpuPercent int64 `protobuf:"varint,6,opt,name=usedCpuPercent,proto3" json:"usedCpuPercent,omitempty"` UsedMemPercent int64 `protobuf:"varint,7,opt,name=usedMemPercent,proto3" json:"usedMemPercent,omitempty"` TotalCpuUnits int64 `protobuf:"varint,8,opt,name=totalCpuUnits,proto3" json:"totalCpuUnits,omitempty"` TotalMem int64 `protobuf:"varint,9,opt,name=totalMem,proto3" json:"totalMem,omitempty"` Ip string `protobuf:"bytes,10,opt,name=ip,proto3" json:"ip,omitempty"` Host string `protobuf:"bytes,11,opt,name=host,proto3" json:"host,omitempty"` User string `protobuf:"bytes,12,opt,name=user,proto3" json:"user,omitempty"` Group string `protobuf:"bytes,13,opt,name=group,proto3" json:"group,omitempty"` Port int64 `protobuf:"varint,14,opt,name=port,proto3" json:"port,omitempty"` Domain string `protobuf:"bytes,15,opt,name=domain,proto3" json:"domain,omitempty"` Fqdn string `protobuf:"bytes,16,opt,name=fqdn,proto3" json:"fqdn,omitempty"` Mac string `protobuf:"bytes,17,opt,name=mac,proto3" json:"mac,omitempty"` Process string `protobuf:"bytes,18,opt,name=process,proto3" json:"process,omitempty"` Geolocation *Geolocation `protobuf:"bytes,19,opt,name=geolocation,proto3" json:"geolocation,omitempty"` File string `protobuf:"bytes,20,opt,name=file,proto3" json:"file,omitempty"` Path string `protobuf:"bytes,21,opt,name=path,proto3" json:"path,omitempty"` Hash string `protobuf:"bytes,22,opt,name=hash,proto3" json:"hash,omitempty"` Url string `protobuf:"bytes,23,opt,name=url,proto3" json:"url,omitempty"` Email string `protobuf:"bytes,24,opt,name=email,proto3" json:"email,omitempty"` // contains filtered or unexported fields }
func (*Side) Descriptor
deprecated
added in
v0.9.0
func (*Side) GetBytesReceived ¶ added in v0.9.0
func (*Side) GetBytesSent ¶ added in v0.9.0
func (*Side) GetConnections ¶ added in v0.9.0
func (*Side) GetGeolocation ¶ added in v0.9.0
func (x *Side) GetGeolocation() *Geolocation
func (*Side) GetPackagesReceived ¶ added in v0.9.0
func (*Side) GetPackagesSent ¶ added in v0.9.0
func (*Side) GetProcess ¶ added in v0.9.0
func (*Side) GetTotalCpuUnits ¶ added in v0.11.14
func (*Side) GetTotalMem ¶ added in v0.11.14
func (*Side) GetUsedCpuPercent ¶ added in v0.9.0
func (*Side) GetUsedMemPercent ¶ added in v0.9.0
func (*Side) ProtoMessage ¶ added in v0.9.0
func (*Side) ProtoMessage()
func (*Side) ProtoReflect ¶ added in v0.9.0
func (x *Side) ProtoReflect() protoreflect.Message
type Step ¶ added in v0.9.0
type Step struct { Kv *Kv `protobuf:"bytes,1,opt,name=kv,proto3" json:"kv,omitempty"` Grok *Grok `protobuf:"bytes,2,opt,name=grok,proto3" json:"grok,omitempty"` Trim *Trim `protobuf:"bytes,3,opt,name=trim,proto3" json:"trim,omitempty"` Json *Json `protobuf:"bytes,4,opt,name=json,proto3" json:"json,omitempty"` Csv *Csv `protobuf:"bytes,5,opt,name=csv,proto3" json:"csv,omitempty"` Rename *Rename `protobuf:"bytes,6,opt,name=rename,proto3" json:"rename,omitempty"` Cast *Cast `protobuf:"bytes,7,opt,name=cast,proto3" json:"cast,omitempty"` Reformat *Reformat `protobuf:"bytes,8,opt,name=reformat,proto3" json:"reformat,omitempty"` Delete *Delete `protobuf:"bytes,9,opt,name=delete,proto3" json:"delete,omitempty"` Drop *Drop `protobuf:"bytes,10,opt,name=drop,proto3" json:"drop,omitempty"` Add *Add `protobuf:"bytes,11,opt,name=add,proto3" json:"add,omitempty"` Dynamic *Dynamic `protobuf:"bytes,12,opt,name=dynamic,proto3" json:"dynamic,omitempty"` // contains filtered or unexported fields }
func (*Step) Descriptor
deprecated
added in
v0.9.0
func (*Step) GetDynamic ¶ added in v0.9.0
func (*Step) GetReformat ¶ added in v0.9.0
func (*Step) ProtoMessage ¶ added in v0.9.0
func (*Step) ProtoMessage()
func (*Step) ProtoReflect ¶ added in v0.9.0
func (x *Step) ProtoReflect() protoreflect.Message
type Tenant ¶ added in v0.9.0
type Tenant struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` Assets []*Asset `protobuf:"bytes,3,rep,name=assets,proto3" json:"assets,omitempty"` DisabledRules []int64 `protobuf:"varint,4,rep,packed,name=disabledRules,proto3" json:"disabledRules,omitempty"` // contains filtered or unexported fields }
func (*Tenant) Descriptor
deprecated
added in
v0.11.0
func (*Tenant) GetDisabledRules ¶ added in v0.11.0
func (*Tenant) ProtoMessage ¶ added in v0.11.0
func (*Tenant) ProtoMessage()
func (*Tenant) ProtoReflect ¶ added in v0.11.0
func (x *Tenant) ProtoReflect() protoreflect.Message
type Topic ¶ added in v0.11.7
type Topic string
const ( TOPIC_ENQUEUE_FAILURE Topic = "enqueue_failure" // TOPIC_ENQUEUE_FAILURE represents the topic name for enqueue failure notifications. TOPIC_ENQUEUE_SUCCESS Topic = "enqueue_success" // TOPIC_ENQUEUE_SUCCESS represents the topic name for enqueue success notifications. TOPIC_INTEGRATION_FAILURE Topic = "integration_failure" // TOPIC_INTEGRATION_FAILURE represents the topic name for integration failure notifications. TOPIC_PARSING_FAILURE Topic = "parsing_failure" // TOPIC_PARSING_FAILURE represents the topic name for parsing failure notifications. TOPIC_ANALYSIS_FAILURE Topic = "analysis_failure" // TOPIC_ANALYSIS_FAILURE represents the topic name for analysis failure notifications. TOPIC_CORRELATION_FAILURE Topic = "correlation_failure" // TOPIC_CORRELATION_FAILURE represents the topic name for correlation failure notifications. TOPIC_OUTGOING_REQUEST_FAILURE Topic = "outgoing_request_failure" // TOPIC_OUTGOING_REQUEST_FAILURE represents the topic name for outgoing request failure notifications. TOPIC_CEL_EVALATUAION_FAILURE Topic = "cel_evaluation_failure" // TOPIC_CEL_EVALUATION_FAILURE represents the topic name for CEL evaluation failure notifications. )
type Transform ¶ added in v0.9.0
type Transform struct { Jlog *JLog `protobuf:"bytes,1,opt,name=jlog,proto3" json:"jlog,omitempty"` Step *Step `protobuf:"bytes,2,opt,name=step,proto3" json:"step,omitempty"` // contains filtered or unexported fields }
func (*Transform) Descriptor
deprecated
added in
v0.9.0
func (*Transform) ProtoMessage ¶ added in v0.9.0
func (*Transform) ProtoMessage()
func (*Transform) ProtoReflect ¶ added in v0.9.0
func (x *Transform) ProtoReflect() protoreflect.Message
type Trim ¶ added in v0.9.0
type Trim struct { Function string `protobuf:"bytes,1,opt,name=function,proto3" json:"function,omitempty"` Substring string `protobuf:"bytes,2,opt,name=substring,proto3" json:"substring,omitempty"` Fields []string `protobuf:"bytes,3,rep,name=fields,proto3" json:"fields,omitempty"` Where *Where `protobuf:"bytes,4,opt,name=where,proto3" json:"where,omitempty"` // contains filtered or unexported fields }
func (*Trim) Descriptor
deprecated
added in
v0.9.0
func (*Trim) GetFunction ¶ added in v0.9.0
func (*Trim) GetSubstring ¶ added in v0.9.0
func (*Trim) ProtoMessage ¶ added in v0.9.0
func (*Trim) ProtoMessage()
func (*Trim) ProtoReflect ¶ added in v0.9.0
func (x *Trim) ProtoReflect() protoreflect.Message
type UnimplementedAnalysisServer ¶ added in v0.9.0
type UnimplementedAnalysisServer struct{}
UnimplementedAnalysisServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedAnalysisServer) Analyze ¶ added in v0.9.0
func (UnimplementedAnalysisServer) Analyze(*Event, grpc.ServerStreamingServer[Alert]) error
type UnimplementedCorrelationServer ¶ added in v0.9.0
type UnimplementedCorrelationServer struct{}
UnimplementedCorrelationServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
type UnimplementedEngineServer ¶ added in v0.9.0
type UnimplementedEngineServer struct{}
UnimplementedEngineServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedEngineServer) Input ¶ added in v0.9.0
func (UnimplementedEngineServer) Input(grpc.BidiStreamingServer[Log, Ack]) error
func (UnimplementedEngineServer) Notify ¶ added in v0.9.0
func (UnimplementedEngineServer) Notify(grpc.BidiStreamingServer[Message, Ack]) error
type UnimplementedIntegrationServer ¶ added in v0.9.0
type UnimplementedIntegrationServer struct{}
UnimplementedIntegrationServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedIntegrationServer) ProcessLog ¶ added in v0.9.0
func (UnimplementedIntegrationServer) ProcessLog(grpc.BidiStreamingServer[Log, Ack]) error
type UnimplementedNotificationServer ¶ added in v0.9.0
type UnimplementedNotificationServer struct{}
UnimplementedNotificationServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
type UnimplementedParsingServer ¶ added in v0.9.0
type UnimplementedParsingServer struct{}
UnimplementedParsingServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
type UnsafeAnalysisServer ¶ added in v0.9.0
type UnsafeAnalysisServer interface {
// contains filtered or unexported methods
}
UnsafeAnalysisServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AnalysisServer will result in compilation errors.
type UnsafeCorrelationServer ¶ added in v0.9.0
type UnsafeCorrelationServer interface {
// contains filtered or unexported methods
}
UnsafeCorrelationServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CorrelationServer will result in compilation errors.
type UnsafeEngineServer ¶ added in v0.9.0
type UnsafeEngineServer interface {
// contains filtered or unexported methods
}
UnsafeEngineServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to EngineServer will result in compilation errors.
type UnsafeIntegrationServer ¶ added in v0.9.0
type UnsafeIntegrationServer interface {
// contains filtered or unexported methods
}
UnsafeIntegrationServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to IntegrationServer will result in compilation errors.
type UnsafeNotificationServer ¶ added in v0.9.0
type UnsafeNotificationServer interface {
// contains filtered or unexported methods
}
UnsafeNotificationServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to NotificationServer will result in compilation errors.
type UnsafeParsingServer ¶ added in v0.9.0
type UnsafeParsingServer interface {
// contains filtered or unexported methods
}
UnsafeParsingServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ParsingServer will result in compilation errors.
type Value_BoolValue ¶ added in v0.9.0
type Value_BoolValue = structpb.Value_BoolValue
type Value_ListValue ¶ added in v0.9.0
type Value_ListValue = structpb.Value_ListValue
type Value_NullValue ¶ added in v0.9.0
type Value_NullValue = structpb.Value_NullValue
type Value_NumberValue ¶ added in v0.9.0
type Value_NumberValue = structpb.Value_NumberValue
type Value_StringValue ¶ added in v0.9.0
type Value_StringValue = structpb.Value_StringValue
type Value_StructValue ¶ added in v0.9.0
type Value_StructValue = structpb.Value_StructValue
type Variable ¶ added in v0.9.0
type Variable struct { Get string `protobuf:"bytes,1,opt,name=get,proto3" json:"get,omitempty"` As string `protobuf:"bytes,2,opt,name=as,proto3" json:"as,omitempty"` OfType string `protobuf:"bytes,3,opt,name=ofType,proto3" json:"ofType,omitempty"` // contains filtered or unexported fields }
func (*Variable) Descriptor
deprecated
added in
v0.9.0
func (*Variable) ProtoMessage ¶ added in v0.9.0
func (*Variable) ProtoMessage()
func (*Variable) ProtoReflect ¶ added in v0.9.0
func (x *Variable) ProtoReflect() protoreflect.Message
type Where ¶ added in v0.9.0
type Where struct { Variables []*Variable `protobuf:"bytes,1,rep,name=variables,proto3" json:"variables,omitempty"` Expression string `protobuf:"bytes,2,opt,name=expression,proto3" json:"expression,omitempty"` // contains filtered or unexported fields }
func (*Where) Descriptor
deprecated
added in
v0.9.0
func (*Where) Evaluate ¶ added in v0.9.0
Evaluate evaluates a given event against the defined expression in the Where struct. It uses the CEL (Common Expression Language) library to compile and evaluate the expression.
Parameters:
- event: A pointer to a string representing the event to be evaluated.
Returns:
- bool: Returns true if the event satisfies the expression, otherwise false.
The function performs the following steps:
- Initializes CEL environment options and a map to hold variable values.
- Iterates over the Variables in the Where struct, setting up CEL variables and extracting values from the event.
- Creates a new CEL environment with the defined variables.
- Compiles the expression in the Where struct.
- If there are any compilation issues, logs the error and returns false.
- Creates a CEL program from the compiled AST.
- If there are any errors creating the program, logs the error and returns false.
- Evaluates the program with the extracted values.
- If there are any evaluation errors, logs the error and returns false.
- Checks if the output type is a boolean and returns its value. Otherwise, returns false.
func (*Where) GetExpression ¶ added in v0.9.0
func (*Where) GetVariables ¶ added in v0.9.0
func (*Where) ProtoMessage ¶ added in v0.9.0
func (*Where) ProtoMessage()
func (*Where) ProtoReflect ¶ added in v0.9.0
func (x *Where) ProtoReflect() protoreflect.Message