syslog

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Out

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

Out writes fluentbit messages via syslog TCP (RFC 5424 and RFC 6587).

func NewOut

func NewOut(sinks, clusterSinks []*Sink, opts ...OutOption) *Out

NewOut returns a new Out which handles both tcp and tls connections.

func (*Out) SinkState added in v0.15.1

func (o *Out) SinkState() []SinkState

func (*Out) Write

func (o *Out) Write(
	record map[interface{}]interface{},
	ts time.Time,
	tag string,
)

Write takes a record, timestamp, and tag, converts it into a syslog message and routes it to the connections with the matching namespace. Each sink has it's own backing network connection and queue. The queue's size is fixed to 10000 messages. It will report dropped messages via a log for every 1000 messages dropped. If no connection is established one will be established per sink upon a Write operation. Write will also write all messages to all cluster sinks provided.

type OutOption

type OutOption func(*Out)

OutOption is the optional setting of write output.

func WithBufferSize

func WithBufferSize(s int) OutOption

WithBufferSize configures write buffer size.

func WithDialTimeout

func WithDialTimeout(d time.Duration) OutOption

WithDialTimeout configures dial up timeout.

func WithSanitizeHost added in v0.20.0

func WithSanitizeHost(s bool) OutOption

WithSanitizeHost configures hostname sanitization to conform to DNS requirements.

func WithWriteTimeout

func WithWriteTimeout(t time.Duration) OutOption

WithWriteTimeout configures write timeout.

type Sink

type Sink struct {
	Addr      string
	Name      string
	Namespace string
	TLS       *TLS
	// contains filtered or unexported fields
}

func (*Sink) LoadSinkError added in v0.15.1

func (s *Sink) LoadSinkError() *SinkError

func (*Sink) MessagesDropped

func (s *Sink) MessagesDropped() int64

type SinkError added in v0.15.1

type SinkError struct {
	Msg       string    `json:"msg"`
	Timestamp time.Time `json:"timestamp"`
}

type SinkState added in v0.15.1

type SinkState struct {
	Name               string     `json:"name"`
	Namespace          string     `json:"namespace"`
	LastSuccessfulSend time.Time  `json:"last_successful_send"`
	Error              *SinkError `json:"error"`
}

type TLS

type TLS struct {
	InsecureSkipVerify bool   `json:"insecure_skip_verify"`
	RootCA             string `json:"root_ca"`
}

Jump to

Keyboard shortcuts

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