Documentation ¶
Index ¶
- func GCIndexes(esClient *elastic.Client, prefix string, config GCConfig)
- func NewStatsdClient(prefix string, tags []string) *statsd.Client
- type Action
- type ActionConfig
- type ActionImpl
- type Alert
- type AlertConfig
- type AlertImpl
- type AlertInfo
- type Cluster
- type ClusterConfig
- type ClusterReliabilityConfig
- type ClusterServerConfig
- type ClusterWorker
- type Config
- type ControlSocket
- type ControlSocketConfig
- type DirectTransformer
- type DiscordWebhookAction
- type Embed
- type EmbedField
- type GCConfig
- type GeoIPMutator
- type Mapping
- type MappingField
- type MatchAlert
- type MessagePayload
- type Mutator
- type State
- type TailRequest
- type Transformer
- type Type
- type TypeConfig
- type TypeSubscriber
- type UnpackMergeTransformer
- type UnpackTakeTransformer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ActionConfig ¶
type ActionImpl ¶
type ActionImpl interface {
Run([]*AlertInfo)
}
func GetActionImplementation ¶
func GetActionImplementation(name string, config map[string]interface{}) ActionImpl
type Alert ¶
type Alert struct { Name string Action *Action State *State Config AlertConfig // contains filtered or unexported fields }
type AlertConfig ¶
type AlertImpl ¶
func GetAlertImplementation ¶
type Cluster ¶
type Cluster struct { Name string State *State Config ClusterConfig Incoming chan *elastic.BulkIndexRequest // contains filtered or unexported fields }
func NewCluster ¶
func NewCluster(state *State, name string, config ClusterConfig) *Cluster
type ClusterConfig ¶
type ClusterConfig struct { URL string `json:"url"` NumWorkers int `json:"num_workers"` BulkSize int `json:"bulk_size"` CommitInterval int `json:"commit_interval"` Reliability ClusterReliabilityConfig `json:"reliability"` Servers []ClusterServerConfig `json:"servers"` Debug bool `json:"debug"` BufferSize int `json:"buffer_size"` }
type ClusterServerConfig ¶
type ClusterWorker ¶
type ClusterWorker struct { Cluster *Cluster // contains filtered or unexported fields }
func NewClusterWorker ¶
func NewClusterWorker(cluster *Cluster) *ClusterWorker
type Config ¶
type Config struct { Clusters map[string]ClusterConfig `json:"clusters"` Types map[string]TypeConfig `json:"types"` Mappings map[string]Mapping `json:"mappings"` Alerts map[string]AlertConfig `json:"alerts"` Actions map[string]ActionConfig `json:"actions"` ControlSocket ControlSocketConfig `json:"control_socket"` GC map[string]GCConfig `json:"gc"` }
func LoadConfig ¶
type ControlSocket ¶
type ControlSocket struct {
// contains filtered or unexported fields
}
func NewControlSocket ¶
func NewControlSocket(state *State, bind string) (*ControlSocket, error)
func (*ControlSocket) Run ¶
func (cs *ControlSocket) Run()
type ControlSocketConfig ¶
type DirectTransformer ¶
type DirectTransformer struct{}
Doesn't perform any transformation or parsing on the syslog structure
func NewDirectTransformer ¶
func NewDirectTransformer(config map[string]interface{}) *DirectTransformer
func (*DirectTransformer) Transform ¶
func (b *DirectTransformer) Transform(parts syslog.SyslogData) (map[string]interface{}, error)
type DiscordWebhookAction ¶
func NewDiscordWebhookAction ¶
func NewDiscordWebhookAction(config map[string]interface{}) *DiscordWebhookAction
func (*DiscordWebhookAction) Run ¶
func (dwa *DiscordWebhookAction) Run(infos []*AlertInfo)
type Embed ¶
type EmbedField ¶
type GeoIPMutator ¶
type GeoIPMutator struct { InputField string OutputFields map[string]interface{} // contains filtered or unexported fields }
func NewGeoIPMutator ¶
func NewGeoIPMutator(config map[string]interface{}) (*GeoIPMutator, error)
func (*GeoIPMutator) Mutate ¶
func (m *GeoIPMutator) Mutate(data map[string]interface{}) error
type Mapping ¶
type Mapping struct { Name string `json:"name"` Fields map[string]MappingField `json:"fields"` All bool `json:"all"` }
func (Mapping) GenerateJSON ¶
type MappingField ¶
type MatchAlert ¶
type MatchAlert struct {
// contains filtered or unexported fields
}
func NewMatchAlert ¶
func NewMatchAlert(config map[string]interface{}) *MatchAlert
func (*MatchAlert) Check ¶
func (ma *MatchAlert) Check(data map[string]interface{}) *AlertInfo
type MessagePayload ¶
type MessagePayload struct {
Embeds []Embed `json:"embeds"`
}
type State ¶
type TailRequest ¶
type Transformer ¶
type Transformer interface {
Transform(parts syslog.SyslogData) (map[string]interface{}, error)
}
func GetTransformer ¶
func GetTransformer(name string, config map[string]interface{}) Transformer
type Type ¶
type Type struct { Config TypeConfig Transformer Transformer Mutators []Mutator Alerts []*Alert // contains filtered or unexported fields }
func NewType ¶
func NewType(config TypeConfig) *Type
type TypeConfig ¶
type TypeConfig struct { Prefix string `json:"prefix"` MappingType string `json:"mapping_type"` DateFormat string `json:"date_format"` Transformer struct { Name string `json:"name"` Config map[string]interface{} `json:"config"` } `json:"transformer"` Mutators []map[string]interface{} `json:"mutators"` Template *struct { NumReplicas *int `json:"num_replicas"` NumShards *int `json:"num_shards"` RefreshInterval *string `json:"refresh_interval"` Mappings []string `json:"mappings"` } `json:"template"` }
type TypeSubscriber ¶
type TypeSubscriber struct {
// contains filtered or unexported fields
}
func NewTypeSubscriber ¶
func NewTypeSubscriber() *TypeSubscriber
type UnpackMergeTransformer ¶
type UnpackMergeTransformer struct{}
Parses the log line as JSON and merges it into the syslog structure
func NewUnpackMergeTransformer ¶
func NewUnpackMergeTransformer(config map[string]interface{}) *UnpackMergeTransformer
func (*UnpackMergeTransformer) Transform ¶
func (u *UnpackMergeTransformer) Transform(parts syslog.SyslogData) (map[string]interface{}, error)
type UnpackTakeTransformer ¶
type UnpackTakeTransformer struct{}
Parses the log line as JSON and uses it as the core structure (ignoring syslog data)
func NewUnpackTakeTransformer ¶
func NewUnpackTakeTransformer(config map[string]interface{}) *UnpackTakeTransformer
func (*UnpackTakeTransformer) Transform ¶
func (u *UnpackTakeTransformer) Transform(parts syslog.SyslogData) (map[string]interface{}, error)
Click to show internal directories.
Click to hide internal directories.