mini-syslog

command module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2017 License: MIT Imports: 7 Imported by: 0

README

mini-syslog

A minimalistic syslog daemon I use when debugging infrastructure, output is similar to papertrail.

asciicast

Installation

Either:

go get github.com/christopherobin/mini-syslog

Or download from the release tab on github and put the binary in your path.

Usage

usage: mini-syslog [<flags>]

Mini-Syslog with papertrail-like output

Flags:
      --help               Show context-sensitive help (also try --help-long and --help-man).
  -b, --bind=":1514"       What IP:Port to bind to
  -p, --protocol=udp       Which protocol to use
      --color              Enable colors
  -t, --template=TEMPLATE  Override output template

Templating

The template system uses go templates and takes the actual syslog message as a map, standards fields provided in the message are:

  • content
  • tag
  • app_name
  • proc_id
  • msg_id
  • structured_data
  • client
  • severity
  • timestamp
  • version
  • hostname
  • message
  • priority
  • facility

A couple helper functions are also provided:

  • severity: Transforms severity integer to colored string
  • bold: Makes text bold
  • blue: Makes text blue
  • gray: Makes text gray
  • green: Makes text green
  • red: Makes text red
  • yellow: Makes text yellow
Default template
{{ .timestamp }} [{{ severity .severity }}] {{ yellow .hostname }} {{ or .app_name .tag | blue }}: {{ or .message .content }}

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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