loggers

package
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 57 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SeverityFinest scalyrSeverity = iota
	SeverityFiner
	SeverityFine
	SeverityInfo
	SeverityWarning
	SeverityError
	SeverityFatal
)

Variables

This section is empty.

Functions

func GetPriority

func GetPriority(facility string) (syslog.Priority, error)

func GetResolverIP added in v0.35.0

func GetResolverIP(dm *dnsutils.DNSMessage) string

func GetStreamGlobal added in v0.40.0

func GetStreamGlobal(dm *dnsutils.DNSMessage) string

Selectors

func GetStreamID added in v0.35.0

func GetStreamID(dm *dnsutils.DNSMessage) string

func IsStdoutValidMode added in v0.33.0

func IsStdoutValidMode(mode string) bool

func IsValidMode added in v0.26.0

func IsValidMode(mode string) bool

func SanitizeMetricName added in v0.22.0

func SanitizeMetricName(metricName string) string

OpenMetrics and the Prometheus exposition format require the metric name to consist only of alphanumericals and "_", ":" and they must not start with digits.

Types

type ClickhouseClient added in v0.43.0

type ClickhouseClient struct {
	RoutingHandler pkgutils.RoutingHandler
	// contains filtered or unexported fields
}

func NewClickhouseClient added in v0.43.0

func NewClickhouseClient(config *pkgconfig.Config, console *logger.Logger, name string) *ClickhouseClient

func (*ClickhouseClient) AddDefaultRoute added in v0.43.0

func (o *ClickhouseClient) AddDefaultRoute(wrk pkgutils.Worker)

func (*ClickhouseClient) AddDroppedRoute added in v0.43.0

func (o *ClickhouseClient) AddDroppedRoute(wrk pkgutils.Worker)

func (*ClickhouseClient) Channel added in v0.43.0

func (o *ClickhouseClient) Channel() chan dnsutils.DNSMessage

func (*ClickhouseClient) GetInputChannel added in v0.43.0

func (o *ClickhouseClient) GetInputChannel() chan dnsutils.DNSMessage

func (*ClickhouseClient) GetName added in v0.43.0

func (o *ClickhouseClient) GetName() string

func (*ClickhouseClient) LogError added in v0.43.0

func (o *ClickhouseClient) LogError(msg string, v ...interface{})

func (*ClickhouseClient) LogInfo added in v0.43.0

func (o *ClickhouseClient) LogInfo(msg string, v ...interface{})

func (*ClickhouseClient) Process added in v0.43.0

func (o *ClickhouseClient) Process()

func (*ClickhouseClient) ReadConfig added in v0.43.0

func (o *ClickhouseClient) ReadConfig()

func (*ClickhouseClient) ReloadConfig added in v0.43.0

func (o *ClickhouseClient) ReloadConfig(config *pkgconfig.Config)

func (*ClickhouseClient) Run added in v0.43.0

func (o *ClickhouseClient) Run()

func (*ClickhouseClient) SetLoggers added in v0.43.0

func (o *ClickhouseClient) SetLoggers(loggers []pkgutils.Worker)

func (*ClickhouseClient) Stop added in v0.43.0

func (o *ClickhouseClient) Stop()

type ClickhouseData added in v0.43.0

type ClickhouseData struct {
	Identity  string `json:"identity"`
	QueryIP   string `json:"query_ip"`
	QName     string `json:"q_name"`
	Operation string `json:"operation"`
	Family    string `json:"family"`
	Protocol  string `json:"protocol"`
	QType     string `json:"q_type"`
	RCode     string `json:"r_code"`
	TimeNSec  string `json:"timensec"`
	TimeStamp string `json:"timestamp"`
}

type DevNull added in v0.42.0

type DevNull struct {
	RoutingHandler pkgutils.RoutingHandler
	// contains filtered or unexported fields
}

func NewDevNull added in v0.42.0

func NewDevNull(config *pkgconfig.Config, console *logger.Logger, name string) *DevNull

func (*DevNull) AddDefaultRoute added in v0.42.0

func (so *DevNull) AddDefaultRoute(wrk pkgutils.Worker)

func (*DevNull) AddDroppedRoute added in v0.42.0

func (so *DevNull) AddDroppedRoute(wrk pkgutils.Worker)

func (*DevNull) GetInputChannel added in v0.42.0

func (so *DevNull) GetInputChannel() chan dnsutils.DNSMessage

func (*DevNull) GetName added in v0.42.0

func (so *DevNull) GetName() string

func (*DevNull) LogError added in v0.42.0

func (so *DevNull) LogError(msg string, v ...interface{})

func (*DevNull) LogInfo added in v0.42.0

func (so *DevNull) LogInfo(msg string, v ...interface{})

func (*DevNull) Process added in v0.42.0

func (so *DevNull) Process()

func (*DevNull) ReadConfig added in v0.42.0

func (so *DevNull) ReadConfig()

func (*DevNull) ReloadConfig added in v0.42.0

func (so *DevNull) ReloadConfig(config *pkgconfig.Config)

func (*DevNull) Run added in v0.42.0

func (so *DevNull) Run()

func (*DevNull) SetLoggers added in v0.42.0

func (so *DevNull) SetLoggers(loggers []pkgutils.Worker)

func (*DevNull) Stop added in v0.42.0

func (so *DevNull) Stop()

type DnstapSender

type DnstapSender struct {
	RoutingHandler pkgutils.RoutingHandler
	// contains filtered or unexported fields
}

func NewDnstapSender

func NewDnstapSender(config *pkgconfig.Config, logger *logger.Logger, name string) *DnstapSender

func (*DnstapSender) AddDefaultRoute added in v0.40.0

func (ds *DnstapSender) AddDefaultRoute(wrk pkgutils.Worker)

func (*DnstapSender) AddDroppedRoute added in v0.40.0

func (ds *DnstapSender) AddDroppedRoute(wrk pkgutils.Worker)

func (*DnstapSender) ConnectToRemote added in v0.31.0

func (ds *DnstapSender) ConnectToRemote()

func (*DnstapSender) Disconnect added in v0.31.0

func (ds *DnstapSender) Disconnect()

func (*DnstapSender) FlushBuffer added in v0.31.0

func (ds *DnstapSender) FlushBuffer(buf *[]dnsutils.DNSMessage)

func (*DnstapSender) GetInputChannel added in v0.40.0

func (ds *DnstapSender) GetInputChannel() chan dnsutils.DNSMessage

func (*DnstapSender) GetName added in v0.22.0

func (ds *DnstapSender) GetName() string

func (*DnstapSender) LogError

func (ds *DnstapSender) LogError(msg string, v ...interface{})

func (*DnstapSender) LogInfo

func (ds *DnstapSender) LogInfo(msg string, v ...interface{})

func (*DnstapSender) Process added in v0.33.0

func (ds *DnstapSender) Process()

func (*DnstapSender) ReadConfig

func (ds *DnstapSender) ReadConfig()

func (*DnstapSender) ReloadConfig added in v0.38.0

func (ds *DnstapSender) ReloadConfig(config *pkgconfig.Config)

func (*DnstapSender) Run

func (ds *DnstapSender) Run()

func (*DnstapSender) SetLoggers added in v0.22.0

func (ds *DnstapSender) SetLoggers(loggers []pkgutils.Worker)

func (*DnstapSender) Stop

func (ds *DnstapSender) Stop()

type ElasticSearchClient added in v0.23.0

type ElasticSearchClient struct {
	RoutingHandler pkgutils.RoutingHandler
	// contains filtered or unexported fields
}

func NewElasticSearchClient added in v0.23.0

func NewElasticSearchClient(config *pkgconfig.Config, console *logger.Logger, name string) *ElasticSearchClient

func (*ElasticSearchClient) AddDefaultRoute added in v0.40.0

func (ec *ElasticSearchClient) AddDefaultRoute(wrk pkgutils.Worker)

func (*ElasticSearchClient) AddDroppedRoute added in v0.40.0

func (ec *ElasticSearchClient) AddDroppedRoute(wrk pkgutils.Worker)

func (*ElasticSearchClient) GetInputChannel added in v0.40.0

func (ec *ElasticSearchClient) GetInputChannel() chan dnsutils.DNSMessage

func (*ElasticSearchClient) GetName added in v0.23.0

func (ec *ElasticSearchClient) GetName() string

func (*ElasticSearchClient) LogError added in v0.23.0

func (ec *ElasticSearchClient) LogError(msg string, v ...interface{})

func (*ElasticSearchClient) LogInfo added in v0.23.0

func (ec *ElasticSearchClient) LogInfo(msg string, v ...interface{})

func (*ElasticSearchClient) ProcessDM added in v0.42.0

func (ec *ElasticSearchClient) ProcessDM()

func (*ElasticSearchClient) ReadConfig added in v0.23.0

func (ec *ElasticSearchClient) ReadConfig()

func (*ElasticSearchClient) ReloadConfig added in v0.38.0

func (ec *ElasticSearchClient) ReloadConfig(config *pkgconfig.Config)

func (*ElasticSearchClient) Run added in v0.23.0

func (ec *ElasticSearchClient) Run()

func (*ElasticSearchClient) SetLoggers added in v0.23.0

func (ec *ElasticSearchClient) SetLoggers(loggers []pkgutils.Worker)

func (*ElasticSearchClient) Stop added in v0.23.0

func (ec *ElasticSearchClient) Stop()

type EpsCounters added in v0.22.0

type EpsCounters struct {
	Eps, EpsMax                  uint64
	TotalEvents, TotalEventsPrev uint64

	TotalRcodes, TotalQtypes                       map[string]float64
	TotalIPVersion, TotalIPProtocol                map[string]float64
	TotalDNSMessages                               float64
	TotalQueries, TotalReplies                     int
	TotalBytes, TotalBytesSent, TotalBytesReceived int

	TotalTC, TotalAA, TotalRA, TotalAD               float64
	TotalMalformed, TotalFragmented, TotalReasembled float64
}

EpsCounters (Events Per Second) - is a set of metrics we calculate on per-second basis. For others we rely on averaging by collector

type FalcoClient added in v0.32.0

type FalcoClient struct {
	RoutingHandler pkgutils.RoutingHandler
	// contains filtered or unexported fields
}

func NewFalcoClient added in v0.32.0

func NewFalcoClient(config *pkgconfig.Config, console *logger.Logger, name string) *FalcoClient

func (*FalcoClient) AddDefaultRoute added in v0.40.0

func (fc *FalcoClient) AddDefaultRoute(wrk pkgutils.Worker)

func (*FalcoClient) AddDroppedRoute added in v0.40.0

func (fc *FalcoClient) AddDroppedRoute(wrk pkgutils.Worker)

func (*FalcoClient) GetInputChannel added in v0.40.0

func (fc *FalcoClient) GetInputChannel() chan dnsutils.DNSMessage

func (*FalcoClient) GetName added in v0.32.0

func (fc *FalcoClient) GetName() string

func (*FalcoClient) LogError added in v0.32.0

func (fc *FalcoClient) LogError(msg string, v ...interface{})

func (*FalcoClient) LogInfo added in v0.32.0

func (fc *FalcoClient) LogInfo(msg string, v ...interface{})

func (*FalcoClient) Process added in v0.33.0

func (fc *FalcoClient) Process()

func (*FalcoClient) ReadConfig added in v0.32.0

func (fc *FalcoClient) ReadConfig()

func (*FalcoClient) ReloadConfig added in v0.38.0

func (fc *FalcoClient) ReloadConfig(config *pkgconfig.Config)

func (*FalcoClient) Run added in v0.32.0

func (fc *FalcoClient) Run()

func (*FalcoClient) SetLoggers added in v0.32.0

func (fc *FalcoClient) SetLoggers(loggers []pkgutils.Worker)

func (*FalcoClient) Stop added in v0.32.0

func (fc *FalcoClient) Stop()

type FluentdClient

type FluentdClient struct {
	RoutingHandler pkgutils.RoutingHandler
	// contains filtered or unexported fields
}

func NewFluentdClient

func NewFluentdClient(config *pkgconfig.Config, logger *logger.Logger, name string) *FluentdClient

func (*FluentdClient) AddDefaultRoute added in v0.40.0

func (fc *FluentdClient) AddDefaultRoute(wrk pkgutils.Worker)

func (*FluentdClient) AddDroppedRoute added in v0.40.0

func (fc *FluentdClient) AddDroppedRoute(wrk pkgutils.Worker)

func (*FluentdClient) ConnectToRemote added in v0.31.0

func (fc *FluentdClient) ConnectToRemote()

func (*FluentdClient) Disconnect added in v0.31.0

func (fc *FluentdClient) Disconnect()

func (*FluentdClient) FlushBuffer added in v0.31.0

func (fc *FluentdClient) FlushBuffer(buf *[]dnsutils.DNSMessage)

func (*FluentdClient) GetInputChannel added in v0.40.0

func (fc *FluentdClient) GetInputChannel() chan dnsutils.DNSMessage

func (*FluentdClient) GetName added in v0.22.0

func (fc *FluentdClient) GetName() string

func (*FluentdClient) LogError

func (fc *FluentdClient) LogError(msg string, v ...interface{})

func (*FluentdClient) LogInfo

func (fc *FluentdClient) LogInfo(msg string, v ...interface{})

func (*FluentdClient) ProcessDM added in v0.42.0

func (fc *FluentdClient) ProcessDM()

func (*FluentdClient) ReadConfig

func (fc *FluentdClient) ReadConfig()

func (*FluentdClient) ReloadConfig added in v0.38.0

func (fc *FluentdClient) ReloadConfig(config *pkgconfig.Config)

func (*FluentdClient) Run

func (fc *FluentdClient) Run()

func (*FluentdClient) SetLoggers added in v0.22.0

func (fc *FluentdClient) SetLoggers(loggers []pkgutils.Worker)

func (*FluentdClient) Stop

func (fc *FluentdClient) Stop()

type HitsRecord added in v0.25.0

type HitsRecord struct {
	TotalHits int            `json:"total-hits"`
	Hits      map[string]int `json:"hits"`
}

type HitsStream added in v0.25.0

type HitsStream struct {
	Streams map[string]SearchBy
}

type HitsUniq added in v0.25.0

type HitsUniq struct {
	Clients        map[string]int
	Domains        map[string]int
	NxDomains      map[string]int
	SfDomains      map[string]int
	PublicSuffixes map[string]int
	Suspicious     map[string]*dnsutils.TransformSuspicious
}

type InfluxDBClient added in v0.13.0

type InfluxDBClient struct {
	RoutingHandler pkgutils.RoutingHandler
	// contains filtered or unexported fields
}

func NewInfluxDBClient added in v0.13.0

func NewInfluxDBClient(config *pkgconfig.Config, logger *logger.Logger, name string) *InfluxDBClient

func (*InfluxDBClient) AddDefaultRoute added in v0.40.0

func (ic *InfluxDBClient) AddDefaultRoute(wrk pkgutils.Worker)

func (*InfluxDBClient) AddDroppedRoute added in v0.40.0

func (ic *InfluxDBClient) AddDroppedRoute(wrk pkgutils.Worker)

func (*InfluxDBClient) GetInputChannel added in v0.40.0

func (ic *InfluxDBClient) GetInputChannel() chan dnsutils.DNSMessage

func (*InfluxDBClient) GetName added in v0.22.0

func (ic *InfluxDBClient) GetName() string

func (*InfluxDBClient) LogError added in v0.13.0

func (ic *InfluxDBClient) LogError(msg string, v ...interface{})

func (*InfluxDBClient) LogInfo added in v0.13.0

func (ic *InfluxDBClient) LogInfo(msg string, v ...interface{})

func (*InfluxDBClient) Process added in v0.33.0

func (ic *InfluxDBClient) Process()

func (*InfluxDBClient) ReadConfig added in v0.13.0

func (ic *InfluxDBClient) ReadConfig()

func (*InfluxDBClient) ReloadConfig added in v0.38.0

func (ic *InfluxDBClient) ReloadConfig(config *pkgconfig.Config)

func (*InfluxDBClient) Run added in v0.13.0

func (ic *InfluxDBClient) Run()

func (*InfluxDBClient) SetLoggers added in v0.22.0

func (ic *InfluxDBClient) SetLoggers(loggers []pkgutils.Worker)

func (*InfluxDBClient) Stop added in v0.13.0

func (ic *InfluxDBClient) Stop()

type KafkaProducer added in v0.32.0

type KafkaProducer struct {
	RoutingHandler pkgutils.RoutingHandler
	// contains filtered or unexported fields
}

func NewKafkaProducer added in v0.32.0

func NewKafkaProducer(config *pkgconfig.Config, logger *logger.Logger, name string) *KafkaProducer

func (*KafkaProducer) AddDefaultRoute added in v0.40.0

func (k *KafkaProducer) AddDefaultRoute(wrk pkgutils.Worker)

func (*KafkaProducer) AddDroppedRoute added in v0.40.0

func (k *KafkaProducer) AddDroppedRoute(wrk pkgutils.Worker)

func (*KafkaProducer) ConnectToKafka added in v0.32.0

func (k *KafkaProducer) ConnectToKafka(ctx context.Context, readyTimer *time.Timer)

func (*KafkaProducer) Disconnect added in v0.32.0

func (k *KafkaProducer) Disconnect()

func (*KafkaProducer) FlushBuffer added in v0.32.0

func (k *KafkaProducer) FlushBuffer(buf *[]dnsutils.DNSMessage)

func (*KafkaProducer) GetInputChannel added in v0.40.0

func (k *KafkaProducer) GetInputChannel() chan dnsutils.DNSMessage

func (*KafkaProducer) GetName added in v0.32.0

func (k *KafkaProducer) GetName() string

func (*KafkaProducer) LogError added in v0.32.0

func (k *KafkaProducer) LogError(msg string, v ...interface{})

func (*KafkaProducer) LogInfo added in v0.32.0

func (k *KafkaProducer) LogInfo(msg string, v ...interface{})

func (*KafkaProducer) ProcessDM added in v0.42.0

func (k *KafkaProducer) ProcessDM()

func (*KafkaProducer) ReadConfig added in v0.32.0

func (k *KafkaProducer) ReadConfig()

func (*KafkaProducer) ReloadConfig added in v0.38.0

func (k *KafkaProducer) ReloadConfig(config *pkgconfig.Config)

func (*KafkaProducer) Run added in v0.32.0

func (k *KafkaProducer) Run()

func (*KafkaProducer) SetLoggers added in v0.32.0

func (k *KafkaProducer) SetLoggers(loggers []pkgutils.Worker)

func (*KafkaProducer) Stop added in v0.32.0

func (k *KafkaProducer) Stop()

type KeyHit added in v0.32.0

type KeyHit struct {
	Key string `json:"key"`
	Hit int    `json:"hit"`
}

type LogFile

type LogFile struct {
	RoutingHandler pkgutils.RoutingHandler
	// contains filtered or unexported fields
}

func NewLogFile

func NewLogFile(config *pkgconfig.Config, logger *logger.Logger, name string) *LogFile

func (*LogFile) AddDefaultRoute added in v0.40.0

func (lf *LogFile) AddDefaultRoute(wrk pkgutils.Worker)

func (*LogFile) AddDroppedRoute added in v0.40.0

func (lf *LogFile) AddDroppedRoute(wrk pkgutils.Worker)

func (*LogFile) Cleanup added in v0.5.0

func (lf *LogFile) Cleanup() error

func (*LogFile) CompressFile added in v0.26.0

func (lf *LogFile) CompressFile()

func (*LogFile) CompressPostRotateCommand added in v0.17.0

func (lf *LogFile) CompressPostRotateCommand(filename string)

func (*LogFile) FlushWriters added in v0.26.0

func (lf *LogFile) FlushWriters()

func (*LogFile) GetInputChannel added in v0.40.0

func (lf *LogFile) GetInputChannel() chan dnsutils.DNSMessage

func (*LogFile) GetMaxSize added in v0.26.0

func (lf *LogFile) GetMaxSize() int64

func (*LogFile) GetName added in v0.22.0

func (lf *LogFile) GetName() string

func (*LogFile) LogError added in v0.5.0

func (lf *LogFile) LogError(msg string, v ...interface{})

func (*LogFile) LogInfo added in v0.5.0

func (lf *LogFile) LogInfo(msg string, v ...interface{})

func (*LogFile) OpenFile

func (lf *LogFile) OpenFile() error

func (*LogFile) PostRotateCommand added in v0.5.0

func (lf *LogFile) PostRotateCommand(filename string)

func (*LogFile) Process added in v0.33.0

func (lf *LogFile) Process()

func (*LogFile) ReadConfig

func (lf *LogFile) ReadConfig()

func (*LogFile) ReloadConfig added in v0.38.0

func (lf *LogFile) ReloadConfig(config *pkgconfig.Config)

func (*LogFile) RotateFile added in v0.26.0

func (lf *LogFile) RotateFile() error

func (*LogFile) Run

func (lf *LogFile) Run()

func (*LogFile) SetLoggers added in v0.22.0

func (lf *LogFile) SetLoggers(loggers []pkgutils.Worker)

func (*LogFile) Stop

func (lf *LogFile) Stop()

func (*LogFile) WriteToDnstap added in v0.26.0

func (lf *LogFile) WriteToDnstap(data []byte)

func (*LogFile) WriteToPcap added in v0.26.0

func (lf *LogFile) WriteToPcap(dm dnsutils.DNSMessage, pkt []gopacket.SerializableLayer)

func (*LogFile) WriteToPlain added in v0.26.0

func (lf *LogFile) WriteToPlain(data []byte)

type LokiClient added in v0.13.0

type LokiClient struct {
	RoutingHandler pkgutils.RoutingHandler
	// contains filtered or unexported fields
}

func NewLokiClient added in v0.13.0

func NewLokiClient(config *pkgconfig.Config, logger *logger.Logger, name string) *LokiClient

func (*LokiClient) AddDefaultRoute added in v0.40.0

func (c *LokiClient) AddDefaultRoute(wrk pkgutils.Worker)

func (*LokiClient) AddDroppedRoute added in v0.40.0

func (c *LokiClient) AddDroppedRoute(wrk pkgutils.Worker)

func (*LokiClient) GetInputChannel added in v0.40.0

func (c *LokiClient) GetInputChannel() chan dnsutils.DNSMessage

func (*LokiClient) GetName added in v0.22.0

func (c *LokiClient) GetName() string

func (*LokiClient) LogError added in v0.13.0

func (c *LokiClient) LogError(msg string, v ...interface{})

func (*LokiClient) LogInfo added in v0.13.0

func (c *LokiClient) LogInfo(msg string, v ...interface{})

func (*LokiClient) Process added in v0.33.0

func (c *LokiClient) Process()

func (*LokiClient) ReadConfig added in v0.13.0

func (c *LokiClient) ReadConfig()

func (*LokiClient) ReloadConfig added in v0.38.0

func (c *LokiClient) ReloadConfig(config *pkgconfig.Config)

func (*LokiClient) Run added in v0.13.0

func (c *LokiClient) Run()

func (*LokiClient) SendEntries added in v0.13.0

func (c *LokiClient) SendEntries(buf []byte)

func (*LokiClient) SetLoggers added in v0.22.0

func (c *LokiClient) SetLoggers(loggers []pkgutils.Worker)

func (*LokiClient) Stop added in v0.13.0

func (c *LokiClient) Stop()

type LokiStream added in v0.17.0

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

func (*LokiStream) Encode2Proto added in v0.17.0

func (o *LokiStream) Encode2Proto() ([]byte, error)

func (*LokiStream) Init added in v0.17.0

func (o *LokiStream) Init()

func (*LokiStream) ResetEntries added in v0.17.0

func (o *LokiStream) ResetEntries()

type PromCounterCatalogueContainer added in v0.35.0

type PromCounterCatalogueContainer struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

PromCounterCatalogueContainer is the implementation of PrometheusCountersCatalogue interface That maps a single label into other Containers or CounterSet The 'chain' of nested Containers keep track of labelNames requested by the config to figure out whether nested Container should be created, or, if all labels but the last one already considered at the upper levels, it is time to create individual CounterSet

func CreateSystemCatalogue added in v0.35.0

func CreateSystemCatalogue(o *Prometheus) ([]string, *PromCounterCatalogueContainer)

This function checks the configuration, to determine which label dimensions were requested by configuration, and returns correct implementation of Catalogue.

func NewPromCounterCatalogueContainer added in v0.35.0

func NewPromCounterCatalogueContainer(p *Prometheus, selLabels []string, l map[string]string) *PromCounterCatalogueContainer

func (*PromCounterCatalogueContainer) GetAllCounterSets added in v0.35.0

func (c *PromCounterCatalogueContainer) GetAllCounterSets() []*PrometheusCountersSet

Returns a slice of all PrometheusCountersSet in a Container

func (*PromCounterCatalogueContainer) GetCountersSet added in v0.35.0

Searches for an existing element for a label value, creating one if not found

type Prometheus added in v0.15.0

type Prometheus struct {
	sync.Mutex

	RoutingHandler pkgutils.RoutingHandler
	// contains filtered or unexported fields
}

func NewPrometheus added in v0.15.0

func NewPrometheus(config *pkgconfig.Config, logger *logger.Logger, name string) *Prometheus

func (*Prometheus) AddDefaultRoute added in v0.40.0

func (c *Prometheus) AddDefaultRoute(wrk pkgutils.Worker)

func (*Prometheus) AddDroppedRoute added in v0.40.0

func (c *Prometheus) AddDroppedRoute(wrk pkgutils.Worker)

func (*Prometheus) ComputeEventsPerSecond added in v0.34.0

func (c *Prometheus) ComputeEventsPerSecond()

func (*Prometheus) GetInputChannel added in v0.40.0

func (c *Prometheus) GetInputChannel() chan dnsutils.DNSMessage

func (*Prometheus) GetName added in v0.22.0

func (c *Prometheus) GetName() string

func (*Prometheus) InitProm added in v0.15.0

func (c *Prometheus) InitProm()

func (*Prometheus) ListenAndServe added in v0.15.0

func (c *Prometheus) ListenAndServe()

func (*Prometheus) LogError added in v0.15.0

func (c *Prometheus) LogError(msg string, v ...interface{})

func (*Prometheus) LogInfo added in v0.15.0

func (c *Prometheus) LogInfo(msg string, v ...interface{})

func (*Prometheus) Process added in v0.33.0

func (c *Prometheus) Process()

func (*Prometheus) ReadConfig added in v0.16.0

func (c *Prometheus) ReadConfig()

func (*Prometheus) Record added in v0.15.0

func (c *Prometheus) Record(dm dnsutils.DNSMessage)

func (*Prometheus) ReloadConfig added in v0.38.0

func (c *Prometheus) ReloadConfig(config *pkgconfig.Config)

func (*Prometheus) Run added in v0.15.0

func (c *Prometheus) Run()

func (*Prometheus) SetLoggers added in v0.22.0

func (c *Prometheus) SetLoggers(loggers []pkgutils.Worker)

func (*Prometheus) Stop added in v0.15.0

func (c *Prometheus) Stop()

type PrometheusCountersCatalogue added in v0.35.0

type PrometheusCountersCatalogue interface {
	// Prometheus logger encapsulates stats counters (PrometheusCounterSet) inside
	// PromCounterCatalogueContainer's. For each label the logger creates a nested level
	// of containers.
	// Containers and CounterSets must implemnent PrometheusCountersCatalogue interface
	// to allow fetching a CounterSet by the list of metric/values by fetching values from
	// the DNS message it logs.
	// There is a schematic sample layout when there are 2 labels considered at the end of this file
	GetCountersSet(*dnsutils.DNSMessage) PrometheusCountersCatalogue
}

type PrometheusCountersSet added in v0.35.0

type PrometheusCountersSet struct {
	sync.Mutex // Each PrometheusCountersSet locks independently
	// contains filtered or unexported fields
}

This type represents a set of counters for a unique set of label name=value pairs. By default, we create a set per setream_id for backward compatibility However, we can allow slicing and dicing data using more dimensions. Each CounterSet is registered with Prometheus collection independently (wrapping label values)

func (*PrometheusCountersSet) Collect added in v0.35.0

func (c *PrometheusCountersSet) Collect(ch chan<- prometheus.Metric)

func (*PrometheusCountersSet) ComputeEventsPerSecond added in v0.35.0

func (c *PrometheusCountersSet) ComputeEventsPerSecond()

func (*PrometheusCountersSet) Describe added in v0.35.0

func (c *PrometheusCountersSet) Describe(ch chan<- *prometheus.Desc)

each CounterSet has the same list of timeseries descriptors, so it uses descriptros from the Prometheus instance the set belongs to.

func (*PrometheusCountersSet) GetCountersSet added in v0.35.0

func (*PrometheusCountersSet) Record added in v0.35.0

Updates all counters for a specific set of labelName=labelValue

type RedisPub added in v0.31.0

type RedisPub struct {
	RoutingHandler pkgutils.RoutingHandler
	// contains filtered or unexported fields
}

func NewRedisPub added in v0.31.0

func NewRedisPub(config *pkgconfig.Config, logger *logger.Logger, name string) *RedisPub

func (*RedisPub) AddDefaultRoute added in v0.40.0

func (c *RedisPub) AddDefaultRoute(wrk pkgutils.Worker)

func (*RedisPub) AddDroppedRoute added in v0.40.0

func (c *RedisPub) AddDroppedRoute(wrk pkgutils.Worker)

func (*RedisPub) ConnectToRemote added in v0.31.0

func (c *RedisPub) ConnectToRemote()

func (*RedisPub) Disconnect added in v0.31.0

func (c *RedisPub) Disconnect()

func (*RedisPub) FlushBuffer added in v0.31.0

func (c *RedisPub) FlushBuffer(buf *[]dnsutils.DNSMessage)

func (*RedisPub) GetInputChannel added in v0.40.0

func (c *RedisPub) GetInputChannel() chan dnsutils.DNSMessage

func (*RedisPub) GetName added in v0.31.0

func (c *RedisPub) GetName() string

func (*RedisPub) LogError added in v0.31.0

func (c *RedisPub) LogError(msg string, v ...interface{})

func (*RedisPub) LogInfo added in v0.31.0

func (c *RedisPub) LogInfo(msg string, v ...interface{})

func (*RedisPub) Process added in v0.33.0

func (c *RedisPub) Process()

func (*RedisPub) ReadConfig added in v0.31.0

func (c *RedisPub) ReadConfig()

func (*RedisPub) ReadFromConnection added in v0.37.0

func (c *RedisPub) ReadFromConnection()

func (*RedisPub) ReloadConfig added in v0.38.0

func (c *RedisPub) ReloadConfig(config *pkgconfig.Config)

func (*RedisPub) Run added in v0.31.0

func (c *RedisPub) Run()

func (*RedisPub) SetLoggers added in v0.31.0

func (c *RedisPub) SetLoggers(loggers []pkgutils.Worker)

func (*RedisPub) Stop added in v0.31.0

func (c *RedisPub) Stop()

type RestAPI added in v0.25.0

type RestAPI struct {
	RoutingHandler pkgutils.RoutingHandler

	HitsStream HitsStream
	HitsUniq   HitsUniq

	Streams map[string]int `json:"streams"`

	TopQnames      *topmap.TopMap
	TopClients     *topmap.TopMap
	TopTLDs        *topmap.TopMap
	TopNonExistent *topmap.TopMap
	TopServFail    *topmap.TopMap

	sync.RWMutex
	// contains filtered or unexported fields
}

func NewRestAPI added in v0.25.0

func NewRestAPI(config *pkgconfig.Config, logger *logger.Logger, name string) *RestAPI

func (*RestAPI) AddDefaultRoute added in v0.40.0

func (c *RestAPI) AddDefaultRoute(wrk pkgutils.Worker)

func (*RestAPI) AddDroppedRoute added in v0.40.0

func (c *RestAPI) AddDroppedRoute(wrk pkgutils.Worker)

func (*RestAPI) BasicAuth added in v0.25.0

func (c *RestAPI) BasicAuth(w http.ResponseWriter, r *http.Request) bool

func (*RestAPI) DeleteResetHandler added in v0.32.0

func (c *RestAPI) DeleteResetHandler(w http.ResponseWriter, r *http.Request)

func (*RestAPI) GetClientsHandler added in v0.25.0

func (c *RestAPI) GetClientsHandler(w http.ResponseWriter, r *http.Request)

func (*RestAPI) GetDomainsHandler added in v0.25.0

func (c *RestAPI) GetDomainsHandler(w http.ResponseWriter, r *http.Request)

func (*RestAPI) GetInputChannel added in v0.40.0

func (c *RestAPI) GetInputChannel() chan dnsutils.DNSMessage

func (*RestAPI) GetName added in v0.25.0

func (c *RestAPI) GetName() string

func (*RestAPI) GetNxDomainsHandler added in v0.25.0

func (c *RestAPI) GetNxDomainsHandler(w http.ResponseWriter, r *http.Request)

func (*RestAPI) GetSearchHandler added in v0.28.0

func (c *RestAPI) GetSearchHandler(w http.ResponseWriter, r *http.Request)

func (*RestAPI) GetSfDomainsHandler added in v0.25.0

func (c *RestAPI) GetSfDomainsHandler(w http.ResponseWriter, r *http.Request)

func (*RestAPI) GetStreamsHandler added in v0.28.0

func (c *RestAPI) GetStreamsHandler(w http.ResponseWriter, r *http.Request)

func (*RestAPI) GetSuspiciousHandler added in v0.25.0

func (c *RestAPI) GetSuspiciousHandler(w http.ResponseWriter, r *http.Request)

func (*RestAPI) GetTLDsHandler added in v0.25.0

func (c *RestAPI) GetTLDsHandler(w http.ResponseWriter, r *http.Request)

func (*RestAPI) GetTopClientsHandler added in v0.25.0

func (c *RestAPI) GetTopClientsHandler(w http.ResponseWriter, r *http.Request)

func (*RestAPI) GetTopDomainsHandler added in v0.25.0

func (c *RestAPI) GetTopDomainsHandler(w http.ResponseWriter, r *http.Request)

func (*RestAPI) GetTopNxDomainsHandler added in v0.25.0

func (c *RestAPI) GetTopNxDomainsHandler(w http.ResponseWriter, r *http.Request)

func (*RestAPI) GetTopSfDomainsHandler added in v0.25.0

func (c *RestAPI) GetTopSfDomainsHandler(w http.ResponseWriter, r *http.Request)

func (*RestAPI) GetTopTLDsHandler added in v0.25.0

func (c *RestAPI) GetTopTLDsHandler(w http.ResponseWriter, r *http.Request)

func (*RestAPI) ListenAndServe added in v0.25.0

func (c *RestAPI) ListenAndServe()

func (*RestAPI) LogError added in v0.25.0

func (c *RestAPI) LogError(msg string, v ...interface{})

func (*RestAPI) LogInfo added in v0.25.0

func (c *RestAPI) LogInfo(msg string, v ...interface{})

func (*RestAPI) Process added in v0.33.0

func (c *RestAPI) Process()

func (*RestAPI) ReadConfig added in v0.25.0

func (c *RestAPI) ReadConfig()

func (*RestAPI) RecordDNSMessage added in v0.39.0

func (c *RestAPI) RecordDNSMessage(dm dnsutils.DNSMessage)

func (*RestAPI) ReloadConfig added in v0.38.0

func (c *RestAPI) ReloadConfig(config *pkgconfig.Config)

func (*RestAPI) Run added in v0.25.0

func (c *RestAPI) Run()

func (*RestAPI) SetLoggers added in v0.25.0

func (c *RestAPI) SetLoggers(loggers []pkgutils.Worker)

func (*RestAPI) Stop added in v0.25.0

func (c *RestAPI) Stop()

type ScalyrClient added in v0.31.0

type ScalyrClient struct {
	RoutingHandler pkgutils.RoutingHandler
	// contains filtered or unexported fields
}

ScalyrClient is a client for Scalyr(https://www.dataset.com/) This client is using the addEvents endpoint, described here: https://app.scalyr.com/help/api#addEvents

func NewScalyrClient added in v0.31.0

func NewScalyrClient(config *pkgconfig.Config, console *logger.Logger, name string) *ScalyrClient

func (*ScalyrClient) AddDefaultRoute added in v0.40.0

func (c *ScalyrClient) AddDefaultRoute(wrk pkgutils.Worker)

func (*ScalyrClient) AddDroppedRoute added in v0.40.0

func (c *ScalyrClient) AddDroppedRoute(wrk pkgutils.Worker)

func (*ScalyrClient) GetInputChannel added in v0.40.0

func (c *ScalyrClient) GetInputChannel() chan dnsutils.DNSMessage

func (*ScalyrClient) GetName added in v0.31.0

func (c *ScalyrClient) GetName() string

func (*ScalyrClient) LogError added in v0.31.0

func (c *ScalyrClient) LogError(msg string, v ...interface{})

func (*ScalyrClient) LogInfo added in v0.31.0

func (c *ScalyrClient) LogInfo(msg string, v ...interface{})

func (*ScalyrClient) Process added in v0.33.0

func (c *ScalyrClient) Process()

func (*ScalyrClient) ReadConfig added in v0.31.0

func (c *ScalyrClient) ReadConfig()

func (*ScalyrClient) ReloadConfig added in v0.38.0

func (c *ScalyrClient) ReloadConfig(config *pkgconfig.Config)

func (*ScalyrClient) Run added in v0.31.0

func (c *ScalyrClient) Run()

func (*ScalyrClient) SetLoggers added in v0.31.0

func (c *ScalyrClient) SetLoggers(loggers []pkgutils.Worker)

func (ScalyrClient) Stop added in v0.31.0

func (c ScalyrClient) Stop()

type SearchBy added in v0.25.0

type SearchBy struct {
	Clients map[string]*HitsRecord
	Domains map[string]*HitsRecord
}

type StatsPerStream added in v0.21.0

type StatsPerStream struct {
	TotalPackets       int
	TotalSentBytes     int
	TotalReceivedBytes int

	Clients   map[string]int
	Domains   map[string]int
	Nxdomains map[string]int

	RRtypes    map[string]int
	Rcodes     map[string]int
	Operations map[string]int
	Transports map[string]int
	IPproto    map[string]int

	TopRcodes     *topmap.TopMap
	TopOperations *topmap.TopMap
	TopIPproto    *topmap.TopMap
	TopTransport  *topmap.TopMap
	TopRRtypes    *topmap.TopMap
}

type StatsdClient added in v0.14.0

type StatsdClient struct {
	RoutingHandler pkgutils.RoutingHandler

	Stats StreamStats
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewStatsdClient added in v0.14.0

func NewStatsdClient(config *pkgconfig.Config, logger *logger.Logger, name string) *StatsdClient

func (*StatsdClient) AddDefaultRoute added in v0.40.0

func (c *StatsdClient) AddDefaultRoute(wrk pkgutils.Worker)

func (*StatsdClient) AddDroppedRoute added in v0.40.0

func (c *StatsdClient) AddDroppedRoute(wrk pkgutils.Worker)

func (*StatsdClient) GetInputChannel added in v0.40.0

func (c *StatsdClient) GetInputChannel() chan dnsutils.DNSMessage

func (*StatsdClient) GetName added in v0.22.0

func (c *StatsdClient) GetName() string

func (*StatsdClient) LogError added in v0.14.0

func (c *StatsdClient) LogError(msg string, v ...interface{})

func (*StatsdClient) LogInfo added in v0.14.0

func (c *StatsdClient) LogInfo(msg string, v ...interface{})

func (*StatsdClient) Process added in v0.33.0

func (c *StatsdClient) Process()

func (*StatsdClient) ReadConfig added in v0.14.0

func (c *StatsdClient) ReadConfig()

func (*StatsdClient) RecordDNSMessage added in v0.39.0

func (c *StatsdClient) RecordDNSMessage(dm dnsutils.DNSMessage)

func (*StatsdClient) ReloadConfig added in v0.38.0

func (c *StatsdClient) ReloadConfig(config *pkgconfig.Config)

func (*StatsdClient) Run added in v0.14.0

func (c *StatsdClient) Run()

func (*StatsdClient) SetLoggers added in v0.22.0

func (c *StatsdClient) SetLoggers(loggers []pkgutils.Worker)

func (*StatsdClient) Stop added in v0.14.0

func (c *StatsdClient) Stop()

type StdOut

type StdOut struct {
	RoutingHandler pkgutils.RoutingHandler
	// contains filtered or unexported fields
}

func NewStdOut

func NewStdOut(config *pkgconfig.Config, console *logger.Logger, name string) *StdOut

func (*StdOut) AddDefaultRoute added in v0.40.0

func (so *StdOut) AddDefaultRoute(wrk pkgutils.Worker)

func (*StdOut) AddDroppedRoute added in v0.40.0

func (so *StdOut) AddDroppedRoute(wrk pkgutils.Worker)

func (*StdOut) GetInputChannel added in v0.40.0

func (so *StdOut) GetInputChannel() chan dnsutils.DNSMessage

func (*StdOut) GetName added in v0.22.0

func (so *StdOut) GetName() string

func (*StdOut) LogError

func (so *StdOut) LogError(msg string, v ...interface{})

func (*StdOut) LogInfo

func (so *StdOut) LogInfo(msg string, v ...interface{})

func (*StdOut) Process added in v0.33.0

func (so *StdOut) Process()

func (*StdOut) ReadConfig

func (so *StdOut) ReadConfig()

func (*StdOut) ReloadConfig added in v0.38.0

func (so *StdOut) ReloadConfig(config *pkgconfig.Config)

func (*StdOut) Run

func (so *StdOut) Run()

func (*StdOut) SetLoggers added in v0.22.0

func (so *StdOut) SetLoggers(loggers []pkgutils.Worker)

func (*StdOut) SetPcapWriter added in v0.38.0

func (so *StdOut) SetPcapWriter(w io.Writer)

func (*StdOut) SetTextWriter added in v0.38.0

func (so *StdOut) SetTextWriter(b *bytes.Buffer)

func (*StdOut) Stop

func (so *StdOut) Stop()

type StreamStats added in v0.25.0

type StreamStats struct {
	Streams map[string]*StatsPerStream
}

type Syslog

type Syslog struct {
	RoutingHandler pkgutils.RoutingHandler
	// contains filtered or unexported fields
}

func NewSyslog

func NewSyslog(config *pkgconfig.Config, console *logger.Logger, name string) *Syslog

func (*Syslog) AddDefaultRoute added in v0.40.0

func (s *Syslog) AddDefaultRoute(wrk pkgutils.Worker)

func (*Syslog) AddDroppedRoute added in v0.40.0

func (s *Syslog) AddDroppedRoute(wrk pkgutils.Worker)

func (*Syslog) ConnectToRemote added in v0.37.0

func (s *Syslog) ConnectToRemote()

func (*Syslog) FlushBuffer added in v0.39.0

func (s *Syslog) FlushBuffer(buf *[]dnsutils.DNSMessage)

func (*Syslog) GetInputChannel added in v0.40.0

func (s *Syslog) GetInputChannel() chan dnsutils.DNSMessage

func (*Syslog) GetName added in v0.22.0

func (s *Syslog) GetName() string

func (*Syslog) LogError

func (s *Syslog) LogError(msg string, v ...interface{})

func (*Syslog) LogInfo

func (s *Syslog) LogInfo(msg string, v ...interface{})

func (*Syslog) Process added in v0.33.0

func (s *Syslog) Process()

func (*Syslog) ReadConfig

func (s *Syslog) ReadConfig()

func (*Syslog) ReloadConfig added in v0.38.0

func (s *Syslog) ReloadConfig(config *pkgconfig.Config)

func (*Syslog) Run

func (s *Syslog) Run()

func (*Syslog) SetLoggers added in v0.22.0

func (s *Syslog) SetLoggers(loggers []pkgutils.Worker)

func (*Syslog) Stop

func (s *Syslog) Stop()

type TCPClient added in v0.39.0

type TCPClient struct {
	RoutingHandler pkgutils.RoutingHandler
	// contains filtered or unexported fields
}

func NewTCPClient added in v0.39.0

func NewTCPClient(config *pkgconfig.Config, logger *logger.Logger, name string) *TCPClient

func (*TCPClient) AddDefaultRoute added in v0.40.0

func (c *TCPClient) AddDefaultRoute(wrk pkgutils.Worker)

func (*TCPClient) AddDroppedRoute added in v0.40.0

func (c *TCPClient) AddDroppedRoute(wrk pkgutils.Worker)

func (*TCPClient) ConnectToRemote added in v0.39.0

func (c *TCPClient) ConnectToRemote()

func (*TCPClient) Disconnect added in v0.39.0

func (c *TCPClient) Disconnect()

func (*TCPClient) FlushBuffer added in v0.39.0

func (c *TCPClient) FlushBuffer(buf *[]dnsutils.DNSMessage)

func (*TCPClient) GetInputChannel added in v0.40.0

func (c *TCPClient) GetInputChannel() chan dnsutils.DNSMessage

func (*TCPClient) GetName added in v0.39.0

func (c *TCPClient) GetName() string

func (*TCPClient) LogError added in v0.39.0

func (c *TCPClient) LogError(msg string, v ...interface{})

func (*TCPClient) LogInfo added in v0.39.0

func (c *TCPClient) LogInfo(msg string, v ...interface{})

func (*TCPClient) Process added in v0.39.0

func (c *TCPClient) Process()

func (*TCPClient) ReadConfig added in v0.39.0

func (c *TCPClient) ReadConfig()

func (*TCPClient) ReadFromConnection added in v0.39.0

func (c *TCPClient) ReadFromConnection()

func (*TCPClient) ReloadConfig added in v0.39.0

func (c *TCPClient) ReloadConfig(config *pkgconfig.Config)

func (*TCPClient) Run added in v0.39.0

func (c *TCPClient) Run()

func (*TCPClient) SetLoggers added in v0.39.0

func (c *TCPClient) SetLoggers(loggers []pkgutils.Worker)

func (*TCPClient) Stop added in v0.39.0

func (c *TCPClient) Stop()

Jump to

Keyboard shortcuts

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