syslogtarget

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultIdleTimeout      = 120 * time.Second
	DefaultMaxMessageLength = 8192
	DefaultProtocol         = protocolTCP
)

Functions

This section is empty.

Types

type ConnPipe

type ConnPipe struct {
	*io.PipeReader
	*io.PipeWriter
	// contains filtered or unexported fields
}

func NewConnPipe

func NewConnPipe(addr net.Addr) *ConnPipe

func (*ConnPipe) Close

func (pipe *ConnPipe) Close() error

type Metrics

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

Metrics holds a set of syslog metrics.

func NewMetrics

func NewMetrics(reg prometheus.Registerer) *Metrics

NewMetrics creates a new set of syslog metrics. If reg is non-nil, the metrics will be registered.

type SyslogTarget

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

SyslogTarget listens to syslog messages. nolint:revive

func NewSyslogTarget

func NewSyslogTarget(
	metrics *Metrics,
	logger log.Logger,
	handler loki.EntryHandler,
	relabel []*relabel.Config,
	config *scrapeconfig.SyslogTargetConfig,
) (*SyslogTarget, error)

NewSyslogTarget configures a new SyslogTarget.

func (*SyslogTarget) Details

func (t *SyslogTarget) Details() interface{}

Details returns target-specific details.

func (*SyslogTarget) DiscoveredLabels

func (t *SyslogTarget) DiscoveredLabels() model.LabelSet

DiscoveredLabels returns the set of labels discovered by the syslog target, which is always nil. Implements Target.

func (*SyslogTarget) Labels

func (t *SyslogTarget) Labels() model.LabelSet

Labels returns the set of labels that statically apply to all log entries produced by the SyslogTarget.

func (*SyslogTarget) ListenAddress

func (t *SyslogTarget) ListenAddress() net.Addr

ListenAddress returns the address SyslogTarget is listening on.

func (*SyslogTarget) Ready

func (t *SyslogTarget) Ready() bool

Ready indicates whether or not the syslog target is ready to be read from.

func (*SyslogTarget) Stop

func (t *SyslogTarget) Stop() error

Stop shuts down the SyslogTarget.

func (*SyslogTarget) Type

func (t *SyslogTarget) Type() target.TargetType

Type returns SyslogTargetType.

type TCPTransport

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

func (*TCPTransport) Addr

func (t *TCPTransport) Addr() net.Addr

Addr implements SyslogTransport

func (*TCPTransport) Close

func (t *TCPTransport) Close() error

Close implements SyslogTransport

func (TCPTransport) Ready

func (t TCPTransport) Ready() bool

Ready implements SyslogTransport

func (*TCPTransport) Run

func (t *TCPTransport) Run() error

Run implements SyslogTransport

func (*TCPTransport) Wait

func (t *TCPTransport) Wait()

Wait implements SyslogTransport

type Transport

type Transport interface {
	Run() error
	Addr() net.Addr
	Ready() bool
	Close() error
	Wait()
}

func NewSyslogTCPTransport

func NewSyslogTCPTransport(config *scrapeconfig.SyslogTargetConfig, handleMessage handleMessage, handleError handleMessageError, logger log.Logger) Transport

func NewSyslogUDPTransport

func NewSyslogUDPTransport(config *scrapeconfig.SyslogTargetConfig, handleMessage handleMessage, handleError handleMessageError, logger log.Logger) Transport

type UDPTransport

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

func (*UDPTransport) Addr

func (t *UDPTransport) Addr() net.Addr

Addr implements SyslogTransport

func (*UDPTransport) Close

func (t *UDPTransport) Close() error

Close implements SyslogTransport

func (UDPTransport) Ready

func (t UDPTransport) Ready() bool

Ready implements SyslogTransport

func (*UDPTransport) Run

func (t *UDPTransport) Run() error

Run implements SyslogTransport

func (*UDPTransport) Wait

func (t *UDPTransport) Wait()

Wait implements SyslogTransport

Jump to

Keyboard shortcuts

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