loggers

package
v0.38.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: MIT Imports: 51 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 GetStreamID added in v0.35.0

func GetStreamID(dm *dnsutils.DnsMessage) string

Selectors

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 DnstapSender

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

func NewDnstapSender

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

func (*DnstapSender) Channel

func (o *DnstapSender) Channel() chan dnsutils.DnsMessage

func (*DnstapSender) ConnectToRemote added in v0.31.0

func (o *DnstapSender) ConnectToRemote()

func (*DnstapSender) Disconnect added in v0.31.0

func (o *DnstapSender) Disconnect()

func (*DnstapSender) FlushBuffer added in v0.31.0

func (o *DnstapSender) FlushBuffer(buf *[]dnsutils.DnsMessage)

func (*DnstapSender) GetName added in v0.22.0

func (c *DnstapSender) GetName() string

func (*DnstapSender) LogError

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

func (*DnstapSender) LogInfo

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

func (*DnstapSender) Process added in v0.33.0

func (o *DnstapSender) Process()

func (*DnstapSender) ReadConfig

func (o *DnstapSender) ReadConfig()

func (*DnstapSender) ReloadConfig added in v0.38.0

func (o *DnstapSender) ReloadConfig(config *dnsutils.Config)

func (*DnstapSender) Run

func (o *DnstapSender) Run()

func (*DnstapSender) SetLoggers added in v0.22.0

func (c *DnstapSender) SetLoggers(loggers []dnsutils.Worker)

func (*DnstapSender) Stop

func (o *DnstapSender) Stop()

type ElasticSearchClient added in v0.23.0

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

func NewElasticSearchClient added in v0.23.0

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

func (*ElasticSearchClient) Channel added in v0.23.0

func (o *ElasticSearchClient) Channel() chan dnsutils.DnsMessage

func (*ElasticSearchClient) FlushBuffer added in v0.35.0

func (o *ElasticSearchClient) FlushBuffer(buf *[]dnsutils.DnsMessage)

func (*ElasticSearchClient) GetName added in v0.23.0

func (c *ElasticSearchClient) GetName() string

func (*ElasticSearchClient) LogError added in v0.23.0

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

func (*ElasticSearchClient) LogInfo added in v0.23.0

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

func (*ElasticSearchClient) Process added in v0.33.0

func (o *ElasticSearchClient) Process()

func (*ElasticSearchClient) ReadConfig added in v0.23.0

func (c *ElasticSearchClient) ReadConfig()

func (*ElasticSearchClient) ReloadConfig added in v0.38.0

func (o *ElasticSearchClient) ReloadConfig(config *dnsutils.Config)

func (*ElasticSearchClient) Run added in v0.23.0

func (o *ElasticSearchClient) Run()

func (*ElasticSearchClient) SetLoggers added in v0.23.0

func (c *ElasticSearchClient) SetLoggers(loggers []dnsutils.Worker)

func (*ElasticSearchClient) Stop added in v0.23.0

func (o *ElasticSearchClient) Stop()

type EpsCounters added in v0.22.0

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

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

	TotalTC         float64
	TotalAA         float64
	TotalRA         float64
	TotalAD         float64
	TotalMalformed  float64
	TotalFragmented float64
	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 FakeLogger

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

func NewFakeLogger

func NewFakeLogger() *FakeLogger

func (*FakeLogger) Channel

func (o *FakeLogger) Channel() chan dnsutils.DnsMessage

func (*FakeLogger) GetName added in v0.22.0

func (c *FakeLogger) GetName() string

func (*FakeLogger) ReadConfig added in v0.16.0

func (o *FakeLogger) ReadConfig()

func (*FakeLogger) ReloadConfig added in v0.38.0

func (o *FakeLogger) ReloadConfig(config *dnsutils.Config)

func (*FakeLogger) Run

func (o *FakeLogger) Run()

func (*FakeLogger) SetLoggers added in v0.22.0

func (c *FakeLogger) SetLoggers(loggers []dnsutils.Worker)

func (*FakeLogger) Stop

func (o *FakeLogger) Stop()

type FalcoClient added in v0.32.0

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

func NewFalcoClient added in v0.32.0

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

func (*FalcoClient) Channel added in v0.32.0

func (f *FalcoClient) Channel() chan dnsutils.DnsMessage

func (*FalcoClient) GetName added in v0.32.0

func (c *FalcoClient) GetName() string

func (*FalcoClient) LogError added in v0.32.0

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

func (*FalcoClient) LogInfo added in v0.32.0

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

func (*FalcoClient) Process added in v0.33.0

func (f *FalcoClient) Process()

func (*FalcoClient) ReadConfig added in v0.32.0

func (c *FalcoClient) ReadConfig()

func (*FalcoClient) ReloadConfig added in v0.38.0

func (c *FalcoClient) ReloadConfig(config *dnsutils.Config)

func (*FalcoClient) Run added in v0.32.0

func (f *FalcoClient) Run()

func (*FalcoClient) SetLoggers added in v0.32.0

func (c *FalcoClient) SetLoggers(loggers []dnsutils.Worker)

func (*FalcoClient) Stop added in v0.32.0

func (f *FalcoClient) Stop()

type FluentdClient

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

func NewFluentdClient

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

func (*FluentdClient) Channel

func (o *FluentdClient) Channel() chan dnsutils.DnsMessage

func (*FluentdClient) ConnectToRemote added in v0.31.0

func (o *FluentdClient) ConnectToRemote()

func (*FluentdClient) Disconnect added in v0.31.0

func (o *FluentdClient) Disconnect()

func (*FluentdClient) FlushBuffer added in v0.31.0

func (o *FluentdClient) FlushBuffer(buf *[]dnsutils.DnsMessage)

func (*FluentdClient) GetName added in v0.22.0

func (c *FluentdClient) GetName() string

func (*FluentdClient) LogError

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

func (*FluentdClient) LogInfo

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

func (*FluentdClient) Process added in v0.33.0

func (o *FluentdClient) Process()

func (*FluentdClient) ReadConfig

func (o *FluentdClient) ReadConfig()

func (*FluentdClient) ReadFromConnection added in v0.38.0

func (o *FluentdClient) ReadFromConnection()

func (*FluentdClient) ReloadConfig added in v0.38.0

func (o *FluentdClient) ReloadConfig(config *dnsutils.Config)

func (*FluentdClient) Run

func (o *FluentdClient) Run()

func (*FluentdClient) SetLoggers added in v0.22.0

func (c *FluentdClient) SetLoggers(loggers []dnsutils.Worker)

func (*FluentdClient) Stop

func (o *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 {
	// contains filtered or unexported fields
}

func NewInfluxDBClient added in v0.13.0

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

func (*InfluxDBClient) Channel added in v0.13.0

func (o *InfluxDBClient) Channel() chan dnsutils.DnsMessage

func (*InfluxDBClient) GetName added in v0.22.0

func (c *InfluxDBClient) GetName() string

func (*InfluxDBClient) LogError added in v0.13.0

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

func (*InfluxDBClient) LogInfo added in v0.13.0

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

func (*InfluxDBClient) Process added in v0.33.0

func (o *InfluxDBClient) Process()

func (*InfluxDBClient) ReadConfig added in v0.13.0

func (o *InfluxDBClient) ReadConfig()

func (*InfluxDBClient) ReloadConfig added in v0.38.0

func (o *InfluxDBClient) ReloadConfig(config *dnsutils.Config)

func (*InfluxDBClient) Run added in v0.13.0

func (o *InfluxDBClient) Run()

func (*InfluxDBClient) SetLoggers added in v0.22.0

func (c *InfluxDBClient) SetLoggers(loggers []dnsutils.Worker)

func (*InfluxDBClient) Stop added in v0.13.0

func (o *InfluxDBClient) Stop()

type KafkaProducer added in v0.32.0

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

func NewKafkaProducer added in v0.32.0

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

func (*KafkaProducer) Channel added in v0.32.0

func (o *KafkaProducer) Channel() chan dnsutils.DnsMessage

func (*KafkaProducer) ConnectToKafka added in v0.32.0

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

func (*KafkaProducer) Disconnect added in v0.32.0

func (o *KafkaProducer) Disconnect()

func (*KafkaProducer) FlushBuffer added in v0.32.0

func (o *KafkaProducer) FlushBuffer(buf *[]dnsutils.DnsMessage)

func (*KafkaProducer) GetName added in v0.32.0

func (c *KafkaProducer) GetName() string

func (*KafkaProducer) LogError added in v0.32.0

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

func (*KafkaProducer) LogInfo added in v0.32.0

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

func (*KafkaProducer) Process added in v0.33.0

func (o *KafkaProducer) Process()

func (*KafkaProducer) ReadConfig added in v0.32.0

func (o *KafkaProducer) ReadConfig()

func (*KafkaProducer) ReloadConfig added in v0.38.0

func (o *KafkaProducer) ReloadConfig(config *dnsutils.Config)

func (*KafkaProducer) Run added in v0.32.0

func (o *KafkaProducer) Run()

func (*KafkaProducer) SetLoggers added in v0.32.0

func (c *KafkaProducer) SetLoggers(loggers []dnsutils.Worker)

func (*KafkaProducer) Stop added in v0.32.0

func (o *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 {
	// contains filtered or unexported fields
}

func NewLogFile

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

func (*LogFile) Channel

func (l *LogFile) Channel() chan dnsutils.DnsMessage

func (*LogFile) Cleanup added in v0.5.0

func (l *LogFile) Cleanup() error

func (*LogFile) CompressFile added in v0.26.0

func (l *LogFile) CompressFile()

func (*LogFile) CompressPostRotateCommand added in v0.17.0

func (l *LogFile) CompressPostRotateCommand(filename string)

func (*LogFile) FlushWriters added in v0.26.0

func (l *LogFile) FlushWriters()

func (*LogFile) GetMaxSize added in v0.26.0

func (o *LogFile) GetMaxSize() int64

func (*LogFile) GetName added in v0.22.0

func (l *LogFile) GetName() string

func (*LogFile) LogError added in v0.5.0

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

func (*LogFile) LogInfo added in v0.5.0

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

func (*LogFile) OpenFile

func (l *LogFile) OpenFile() error

func (*LogFile) PostRotateCommand added in v0.5.0

func (l *LogFile) PostRotateCommand(filename string)

func (*LogFile) Process added in v0.33.0

func (l *LogFile) Process()

func (*LogFile) ReadConfig

func (l *LogFile) ReadConfig()

func (*LogFile) ReloadConfig added in v0.38.0

func (o *LogFile) ReloadConfig(config *dnsutils.Config)

func (*LogFile) RotateFile added in v0.26.0

func (l *LogFile) RotateFile() error

func (*LogFile) Run

func (l *LogFile) Run()

func (*LogFile) SetLoggers added in v0.22.0

func (l *LogFile) SetLoggers(loggers []dnsutils.Worker)

func (*LogFile) Stop

func (l *LogFile) Stop()

func (*LogFile) WriteToDnstap added in v0.26.0

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

func (*LogFile) WriteToPcap added in v0.26.0

func (l *LogFile) WriteToPcap(dm dnsutils.DnsMessage, pkt []gopacket.SerializableLayer)

func (*LogFile) WriteToPlain added in v0.26.0

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

type LokiClient added in v0.13.0

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

func NewLokiClient added in v0.13.0

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

func (*LokiClient) Channel added in v0.13.0

func (o *LokiClient) Channel() 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 (o *LokiClient) LogError(msg string, v ...interface{})

func (*LokiClient) LogInfo added in v0.13.0

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

func (*LokiClient) Process added in v0.33.0

func (o *LokiClient) Process()

func (*LokiClient) ReadConfig added in v0.13.0

func (o *LokiClient) ReadConfig()

func (*LokiClient) ReloadConfig added in v0.38.0

func (o *LokiClient) ReloadConfig(config *dnsutils.Config)

func (*LokiClient) Run added in v0.13.0

func (o *LokiClient) Run()

func (*LokiClient) SendEntries added in v0.13.0

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

func (*LokiClient) SetLoggers added in v0.22.0

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

func (*LokiClient) Stop added in v0.13.0

func (o *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 label_names 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(prom *Prometheus) ([]string, *PromCounterCatalogueContainer)

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

func NewPromCounterCatalogueContainer added in v0.35.0

func NewPromCounterCatalogueContainer(p *Prometheus, sel_labels []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
	// contains filtered or unexported fields
}

func NewPrometheus added in v0.15.0

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

func (*Prometheus) Channel added in v0.15.0

func (o *Prometheus) Channel() chan dnsutils.DnsMessage

func (*Prometheus) ComputeEventsPerSecond added in v0.34.0

func (o *Prometheus) ComputeEventsPerSecond()

func (*Prometheus) GetName added in v0.22.0

func (c *Prometheus) GetName() string

func (*Prometheus) InitProm added in v0.15.0

func (o *Prometheus) InitProm()

func (*Prometheus) ListenAndServe added in v0.15.0

func (s *Prometheus) ListenAndServe()

func (*Prometheus) LogError added in v0.15.0

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

func (*Prometheus) LogInfo added in v0.15.0

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

func (*Prometheus) Process added in v0.33.0

func (s *Prometheus) Process()

func (*Prometheus) ReadConfig added in v0.16.0

func (o *Prometheus) ReadConfig()

func (*Prometheus) Record added in v0.15.0

func (o *Prometheus) Record(dm dnsutils.DnsMessage)

func (*Prometheus) ReloadConfig added in v0.38.0

func (o *Prometheus) ReloadConfig(config *dnsutils.Config)

func (*Prometheus) Run added in v0.15.0

func (s *Prometheus) Run()

func (*Prometheus) SetLoggers added in v0.22.0

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

func (*Prometheus) Stop added in v0.15.0

func (o *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 dimentions. Each CounterSet is registered with Prometheus collection independently (wrapping label values)

func (*PrometheusCountersSet) Collect added in v0.35.0

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

func (*PrometheusCountersSet) ComputeEventsPerSecond added in v0.35.0

func (o *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 {
	// contains filtered or unexported fields
}

func NewRedisPub added in v0.31.0

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

func (*RedisPub) Channel added in v0.31.0

func (o *RedisPub) Channel() chan dnsutils.DnsMessage

func (*RedisPub) ConnectToRemote added in v0.31.0

func (o *RedisPub) ConnectToRemote()

func (*RedisPub) Disconnect added in v0.31.0

func (o *RedisPub) Disconnect()

func (*RedisPub) FlushBuffer added in v0.31.0

func (o *RedisPub) FlushBuffer(buf *[]dnsutils.DnsMessage)

func (*RedisPub) GetName added in v0.31.0

func (c *RedisPub) GetName() string

func (*RedisPub) LogError added in v0.31.0

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

func (*RedisPub) LogInfo added in v0.31.0

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

func (*RedisPub) Process added in v0.33.0

func (o *RedisPub) Process()

func (*RedisPub) ReadConfig added in v0.31.0

func (o *RedisPub) ReadConfig()

func (*RedisPub) ReadFromConnection added in v0.37.0

func (o *RedisPub) ReadFromConnection()

func (*RedisPub) ReloadConfig added in v0.38.0

func (o *RedisPub) ReloadConfig(config *dnsutils.Config)

func (*RedisPub) Run added in v0.31.0

func (o *RedisPub) Run()

func (*RedisPub) SetLoggers added in v0.31.0

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

func (*RedisPub) Stop added in v0.31.0

func (o *RedisPub) Stop()

type RestAPI added in v0.25.0

type RestAPI struct {
	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 *dnsutils.Config, logger *logger.Logger, name string) *RestAPI

func (*RestAPI) BasicAuth added in v0.25.0

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

func (*RestAPI) Channel added in v0.25.0

func (o *RestAPI) Channel() chan dnsutils.DnsMessage

func (*RestAPI) DeleteResetHandler added in v0.32.0

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

func (*RestAPI) GetClientsHandler added in v0.25.0

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

func (*RestAPI) GetDomainsHandler added in v0.25.0

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

func (*RestAPI) GetName added in v0.25.0

func (c *RestAPI) GetName() string

func (*RestAPI) GetNxDomainsHandler added in v0.25.0

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

func (*RestAPI) GetSearchHandler added in v0.28.0

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

func (*RestAPI) GetSfDomainsHandler added in v0.25.0

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

func (*RestAPI) GetStreamsHandler added in v0.28.0

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

func (*RestAPI) GetSuspiciousHandler added in v0.25.0

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

func (*RestAPI) GetTLDsHandler added in v0.25.0

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

func (*RestAPI) GetTopClientsHandler added in v0.25.0

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

func (*RestAPI) GetTopDomainsHandler added in v0.25.0

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

func (*RestAPI) GetTopNxDomainsHandler added in v0.25.0

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

func (*RestAPI) GetTopSfDomainsHandler added in v0.25.0

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

func (*RestAPI) GetTopTLDsHandler added in v0.25.0

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

func (*RestAPI) ListenAndServe added in v0.25.0

func (s *RestAPI) ListenAndServe()

func (*RestAPI) LogError added in v0.25.0

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

func (*RestAPI) LogInfo added in v0.25.0

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

func (*RestAPI) Process added in v0.33.0

func (s *RestAPI) Process()

func (*RestAPI) ReadConfig added in v0.25.0

func (o *RestAPI) ReadConfig()

func (*RestAPI) RecordDnsMessage added in v0.25.0

func (s *RestAPI) RecordDnsMessage(dm dnsutils.DnsMessage)

func (*RestAPI) ReloadConfig added in v0.38.0

func (o *RestAPI) ReloadConfig(config *dnsutils.Config)

func (*RestAPI) Run added in v0.25.0

func (s *RestAPI) Run()

func (*RestAPI) SetLoggers added in v0.25.0

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

func (*RestAPI) Stop added in v0.25.0

func (o *RestAPI) Stop()

type ScalyrClient added in v0.31.0

type ScalyrClient struct {
	// 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 *dnsutils.Config, console *logger.Logger, name string) *ScalyrClient

func (*ScalyrClient) Channel added in v0.31.0

func (c *ScalyrClient) Channel() 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 (o *ScalyrClient) ReloadConfig(config *dnsutils.Config)

func (*ScalyrClient) Run added in v0.31.0

func (o *ScalyrClient) Run()

func (*ScalyrClient) SetLoggers added in v0.31.0

func (c *ScalyrClient) SetLoggers(loggers []dnsutils.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 {
	Stats StreamStats
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewStatsdClient added in v0.14.0

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

func (*StatsdClient) Channel added in v0.14.0

func (o *StatsdClient) Channel() 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 (o *StatsdClient) LogError(msg string, v ...interface{})

func (*StatsdClient) LogInfo added in v0.14.0

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

func (*StatsdClient) Process added in v0.33.0

func (o *StatsdClient) Process()

func (*StatsdClient) ReadConfig added in v0.14.0

func (o *StatsdClient) ReadConfig()

func (*StatsdClient) RecordDnsMessage added in v0.25.0

func (o *StatsdClient) RecordDnsMessage(dm dnsutils.DnsMessage)

func (*StatsdClient) ReloadConfig added in v0.38.0

func (o *StatsdClient) ReloadConfig(config *dnsutils.Config)

func (*StatsdClient) Run added in v0.14.0

func (o *StatsdClient) Run()

func (*StatsdClient) SetLoggers added in v0.22.0

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

func (*StatsdClient) Stop added in v0.14.0

func (o *StatsdClient) Stop()

type StdOut

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

func NewStdOut

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

func (*StdOut) Channel

func (o *StdOut) Channel() chan dnsutils.DnsMessage

func (*StdOut) GetName added in v0.22.0

func (c *StdOut) GetName() string

func (*StdOut) LogError

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

func (*StdOut) LogInfo

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

func (*StdOut) Process added in v0.33.0

func (o *StdOut) Process()

func (*StdOut) ReadConfig

func (c *StdOut) ReadConfig()

func (*StdOut) ReloadConfig added in v0.38.0

func (o *StdOut) ReloadConfig(config *dnsutils.Config)

func (*StdOut) Run

func (o *StdOut) Run()

func (*StdOut) SetLoggers added in v0.22.0

func (c *StdOut) SetLoggers(loggers []dnsutils.Worker)

func (*StdOut) SetPcapWriter added in v0.38.0

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

func (*StdOut) SetTextWriter added in v0.38.0

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

func (*StdOut) Stop

func (o *StdOut) Stop()

type StreamStats added in v0.25.0

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

type Syslog

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

func NewSyslog

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

func (*Syslog) Channel

func (o *Syslog) Channel() chan dnsutils.DnsMessage

func (*Syslog) ConnectToRemote added in v0.37.0

func (o *Syslog) ConnectToRemote()

func (*Syslog) GetName added in v0.22.0

func (c *Syslog) GetName() string

func (*Syslog) LogError

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

func (*Syslog) LogInfo

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

func (*Syslog) Process added in v0.33.0

func (o *Syslog) Process()

func (*Syslog) ReadConfig

func (c *Syslog) ReadConfig()

func (*Syslog) ReloadConfig added in v0.38.0

func (o *Syslog) ReloadConfig(config *dnsutils.Config)

func (*Syslog) Run

func (o *Syslog) Run()

func (*Syslog) SetLoggers added in v0.22.0

func (c *Syslog) SetLoggers(loggers []dnsutils.Worker)

func (*Syslog) Stop

func (o *Syslog) Stop()

type TcpClient

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

func NewTcpClient

func NewTcpClient(config *dnsutils.Config, logger *logger.Logger, name string) *TcpClient

func (*TcpClient) Channel

func (o *TcpClient) Channel() chan dnsutils.DnsMessage

func (*TcpClient) ConnectToRemote added in v0.31.0

func (o *TcpClient) ConnectToRemote()

func (*TcpClient) Disconnect added in v0.31.0

func (o *TcpClient) Disconnect()

func (*TcpClient) FlushBuffer added in v0.31.0

func (o *TcpClient) FlushBuffer(buf *[]dnsutils.DnsMessage)

func (*TcpClient) GetName added in v0.22.0

func (c *TcpClient) GetName() string

func (*TcpClient) LogError

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

func (*TcpClient) LogInfo

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

func (*TcpClient) Process added in v0.33.0

func (o *TcpClient) Process()

func (*TcpClient) ReadConfig

func (o *TcpClient) ReadConfig()

func (*TcpClient) ReadFromConnection added in v0.38.0

func (o *TcpClient) ReadFromConnection()

func (*TcpClient) ReloadConfig added in v0.38.0

func (o *TcpClient) ReloadConfig(config *dnsutils.Config)

func (*TcpClient) Run

func (o *TcpClient) Run()

func (*TcpClient) SetLoggers added in v0.22.0

func (c *TcpClient) SetLoggers(loggers []dnsutils.Worker)

func (*TcpClient) Stop

func (o *TcpClient) Stop()

Jump to

Keyboard shortcuts

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