All Projects → alexferl → tinysyslog

alexferl / tinysyslog

Licence: MIT License
A tiny and simple syslog server with log rotation in Go. Works with Docker and Kubernetes.

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to tinysyslog

WatsonSyslogServer
C# Syslog Server
Stars: ✭ 18 (-30.77%)
Mutual labels:  syslog, syslog-server
rfc5424-logging-handler
An RFC5424-Compliant Syslog Handler for the Python Logging Framework
Stars: ✭ 42 (+61.54%)
Mutual labels:  syslog, rfc5424
unzip
Tiny unzip helper class for .NET 3.5 Client Profile and Mono 2.10, written in pure C#.
Stars: ✭ 25 (-3.85%)
Mutual labels:  tiny
nim-syslog
Nim syslog module
Stars: ✭ 17 (-34.62%)
Mutual labels:  syslog
SSTMCSPGAAS
Stupidly Simple Tiny Minimal Coming Soon Page Generator As A Service
Stars: ✭ 23 (-11.54%)
Mutual labels:  tiny
R8051
8051 soft CPU core. 700-lines statements for 111 instructions . Fully synthesizable Verilog-2001 core.
Stars: ✭ 70 (+169.23%)
Mutual labels:  tiny
wymlp
tiny fast portable real-time deep neural network for regression and classification within 50 LOC.
Stars: ✭ 36 (+38.46%)
Mutual labels:  tiny
alerta-contrib
Contributed integrations, plugins and custom webhooks
Stars: ✭ 107 (+311.54%)
Mutual labels:  syslog
Microdot
The Microdot Project guides you to create a fully functional but compact Linux system from scratch
Stars: ✭ 41 (+57.69%)
Mutual labels:  tiny
kernel-syslog
📝 Kernel module that can be used as a replacement for syslog, logger or logwrapper
Stars: ✭ 37 (+42.31%)
Mutual labels:  syslog
Square
The Square Programming Language. A tiny programming language under 200kb.
Stars: ✭ 23 (-11.54%)
Mutual labels:  tiny
power-mode-input
PowerModeInput can make your text input box more compelling
Stars: ✭ 68 (+161.54%)
Mutual labels:  tiny
docker-rsyslog
Rsyslog server with multiple input listeners (UDP/TCP/RELP) and outputs (file/kafka/syslog).
Stars: ✭ 18 (-30.77%)
Mutual labels:  syslog
permissionary
Tiny and framework-agnostic role-based permission management using composition over inheritance
Stars: ✭ 19 (-26.92%)
Mutual labels:  tiny
teaful
🍵 Tiny, easy and powerful React state management
Stars: ✭ 638 (+2353.85%)
Mutual labels:  tiny
uuix
A tiny (<1KB) and fast UUID (v4) generator for Crystal
Stars: ✭ 17 (-34.62%)
Mutual labels:  tiny
kolorist
A tiny utility to colorize stdin/stdout
Stars: ✭ 160 (+515.38%)
Mutual labels:  tiny
tiny-framework
A light wight easy to use RESTful apis framework for education & demo purposes. stripped down framework to the fundamental components that that every one would essentially need to (learn / make a demo application).
Stars: ✭ 13 (-50%)
Mutual labels:  tiny
narc
Small utility to watch log files and ship to syslog service.
Stars: ✭ 18 (-30.77%)
Mutual labels:  syslog
events
Tiny type-safe event emitter
Stars: ✭ 25 (-3.85%)
Mutual labels:  tiny

tinysyslog

Go Report Card

A tiny and simple syslog server with log rotation. tinysyslog was born out of the need for a tiny (the binary is currently ~10MB in size), easy to setup and use syslog server that simply writes every incoming log (RFC5424 format) to a file (or to stdout for Docker) that is automatically rotated. tinysyslog is based on go-syslog and lumberjack.

Quickstart

To install tinysyslog:

go get -u github.com/admiralobvious/tinysyslog

And then to run it (from your $GOPATH/bin folder):

./tinysyslog

If tinysyslog started properly you should see:

INFO[0000] tinysyslog listening on 127.0.0.1:5140

You can take make sure logs are processed by the server by entering the following in a terminal:

nc -w0 -u 127.0.0.1 5140 <<< '<165>1 2016-01-01T12:01:21Z hostname appname 1234 ID47 [exampleSDID@32473 iut="9" eventSource="test" eventID="123"] message'

You should then see the following output in your terminal:

Jan  1 12:01:21 hostname appname[1234]: message

Docker Quickstart

Download the image:

docker pull admiralobvious/tinysyslog

Start the container:

docker run --rm --name tinysyslog -p 5140:5140/udp -d admiralobvious/tinysyslog

Send a log:

nc -w0 -u 127.0.0.1 5140 <<< '<165>1 2016-01-01T12:01:21Z hostname appname 1234 ID47 [exampleSDID@32473 iut="9" eventSource="test" eventID="123"] message'

Confirm the container received it:

docker logs tinysyslog
time="2018-11-15T19:40:22Z" level=info msg="tinysyslog listening on 0.0.0.0:5140"
Jan  1 12:01:21 hostname appname[1234]: message

Kubernetes Quickstart

Apply the manifest to your cluster:

kubectl apply -f kubernetes/tinysyslog.yaml

Make sure the container is running:

kubectl get pods | grep tinysyslog
tinysyslog-6c85886f65-q9cxw          1/1       Running   0          1m

Confirm the pod started properly:

kubectl logs tinysyslog-6c85886f65-q9cxw
time="2018-11-15T20:02:06Z" level=info msg="tinysyslog listening on 0.0.0.0:5140"

You can now send logs from your app(s) to tinysyslog:5140.

Configuration

Usage of ./tinysyslog:
      --address string                         IP and port to listen on. (default "127.0.0.1:5140")
      --filter string                          Filter to filter logs with. Valid filters are: null and regex. Null doesn't do any filtering. (default "null")
      --filter-grok-fields strings             Grok fields to keep.
      --filter-grok-pattern string             Grok pattern to filter with.
      --filter-regex string                    Regex to filter with.
      --log-file string                        The log file to write to. 'stdout' means log to stdout and 'stderr' means log to stderr. (default "stdout")
      --log-format string                      The log format. Valid format values are: text, json. (default "text")
      --log-level string                       The granularity of log outputs. Valid level names are: debug, info, warning, error and critical. (default "info")
      --mutator string                         Mutator type to use. Valid mutators are: text, json. (default "text")
      --sink-console-output string             Console to output too. Valid outputs are: stdout, stderr. (default "stdout")
      --sink-elasticsearch-address string      Elasticsearch server address. (default "http://127.0.0.1:9200")
      --sink-elasticsearch-index-name string   Elasticsearch index name. (default "tinysyslog")
      --sink-filesystem-filename string        File to write incoming logs to. (default "syslog.log")
      --sink-filesystem-max-age int            Maximum age (in days) before a log is deleted. (default 30)
      --sink-filesystem-max-backups int        Maximum backups to keep. (default 10)
      --sink-filesystem-max-size int           Maximum log size (in megabytes) before it's rotated. (default 100)
      --sinks strings                          Sinks to save syslogs to. Valid sinks are: console, elasticsearch and filesystem. (default [console])
      --socket-type string                     Type of socket to use, TCP or UDP. If no type is specified, both are used.

Benchmarks

Nothing scientific here but with a simple client consisting of a for loop sending large messages as fast as possible over UDP:

iostat -d 5

    KB/t tps  MB/s
  127.61 585 72.95
  127.66 592 73.74
  126.41 591 72.98
  126.36 590 72.76
  124.76 615 74.95
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].