syslogp

package module
v0.0.0-...-ea5a130 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: MIT Imports: 7 Imported by: 0

README

Go Report Card Build License

Repository archived. No longer actively maintained.

This project is not maintained anymore. I recommend you using https://github.com/influxdata/go-syslog/blob/develop/rfc5424/builder.go instead, which has all the features this library provided plus tons of others. It is also maintained by the InfluxDB engineering team, which ensures continuity on development.

syslog-format

A syslog formatter Golang library.

Standards

This library formats syslog messages according the RFC5424 and RFC3164.

Installation

$ go get github.com/smoya/syslog-format

Test

Coverage: https://gocover.io/github.com/smoya/syslog-format

TODO

  • Port syslog pkg dial functionality and adapt it with this formatter. The syslog only supports the RFC3164.
  • Add support for multiple structured data chunks. Right now only supports one, with the name context@{pid}.
  • Add support for standard structured data SD-ID. More info here.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRFC3164Formatter

func NewRFC3164Formatter(facility syslog.Priority, severity syslog.Priority, time time.Time, hostname string, app string, pid int, msg string) (io.Reader, error)

NewRFC3164Formatter returns a formatter for this specific RFC. See https://tools.ietf.org/html/rfc3164

func NewRFC5424Formatter

func NewRFC5424Formatter(facility syslog.Priority, severity syslog.Priority, time time.Time, hostname string, app string, pid int, msgID string, fields Fields, msg string) (io.Reader, error)

NewRFC5424Formatter returns a formatter for this specific RFC. See https://tools.ietf.org/html/rfc5424

Types

type Fields

type Fields map[string]interface{}

Fields for the RFC5424.

Jump to

Keyboard shortcuts

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