All Projects → otoolep → Syslog Gollector

otoolep / Syslog Gollector

Licence: mit
Syslog Collector written in Go, streams to Kafka 0.8

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Labels

Projects that are alternatives of or similar to Syslog Gollector

Distributed framework
python通用分布式函数调度框架 pip install function_scheduling_distributed_framework
Stars: ✭ 123 (-10.87%)
Mutual labels:  kafka
Iot Traffic Monitor
Stars: ✭ 131 (-5.07%)
Mutual labels:  kafka
Goka
Goka is a compact yet powerful distributed stream processing library for Apache Kafka written in Go.
Stars: ✭ 1,862 (+1249.28%)
Mutual labels:  kafka
Docker Bro
Bro IDS Dockerfile
Stars: ✭ 126 (-8.7%)
Mutual labels:  kafka
Kafka Junit
This library wraps Kafka's embedded test cluster, allowing you to more easily create and run integration tests using JUnit against a "real" kafka server running within the context of your tests. No need to stand up an external kafka cluster!
Stars: ✭ 131 (-5.07%)
Mutual labels:  kafka
Samsara
Samsara is a real-time analytics platform
Stars: ✭ 132 (-4.35%)
Mutual labels:  kafka
Apiproject
[https://www.sofineday.com], golang项目开发脚手架,集成最佳实践(gin+gorm+go-redis+mongo+cors+jwt+json日志库zap(支持日志收集到kafka或mongo)+消息队列kafka+微信支付宝支付gopay+api加密+api反向代理+go modules依赖管理+headless爬虫chromedp+makefile+二进制压缩+livereload热加载)
Stars: ✭ 124 (-10.14%)
Mutual labels:  kafka
Kafka Connect Mongodb
**Unofficial / Community** Kafka Connect MongoDB Sink Connector - Find the official MongoDB Kafka Connector here: https://www.mongodb.com/kafka-connector
Stars: ✭ 137 (-0.72%)
Mutual labels:  kafka
Metronome
Metronome is a distributed and fault-tolerant event scheduler
Stars: ✭ 131 (-5.07%)
Mutual labels:  kafka
Node Rdkafka
Node.js bindings for librdkafka
Stars: ✭ 1,799 (+1203.62%)
Mutual labels:  kafka
Faust
Python Stream Processing. A Faust fork
Stars: ✭ 124 (-10.14%)
Mutual labels:  kafka
Abris
Avro SerDe for Apache Spark structured APIs.
Stars: ✭ 130 (-5.8%)
Mutual labels:  kafka
Aliyun Emapreduce Datasources
Extended datasource support for Spark/Hadoop on Aliyun E-MapReduce.
Stars: ✭ 132 (-4.35%)
Mutual labels:  kafka
Neo4j Streams
Neo4j Kafka Integrations, Docs =>
Stars: ✭ 126 (-8.7%)
Mutual labels:  kafka
Secor
Secor is a service implementing Kafka log persistence
Stars: ✭ 1,728 (+1152.17%)
Mutual labels:  kafka
Azure Event Hubs For Kafka
Azure Event Hubs for Apache Kafka Ecosystems
Stars: ✭ 124 (-10.14%)
Mutual labels:  kafka
Components Contrib
Community driven, reusable components for distributed apps
Stars: ✭ 131 (-5.07%)
Mutual labels:  kafka
Strimzi Kafka Bridge
Apache Kafka bridge
Stars: ✭ 137 (-0.72%)
Mutual labels:  kafka
Waterdrop
WaterDrop is a standalone Karafka component library for generating Kafka messages
Stars: ✭ 136 (-1.45%)
Mutual labels:  kafka
Echo
🦄 开源社区系统:基于 SpringBoot + MyBatis + MySQL + Redis + Kafka + Elasticsearch + Spring Security + ... 并提供详细的开发文档和配套教程。包含帖子、评论、私信、系统通知、点赞、关注、搜索、用户设置、数据统计等模块。
Stars: ✭ 129 (-6.52%)
Mutual labels:  kafka

syslog-gollector Circle CI Go Report Card

Detailed background on syslog-gollector can be found on these blog posts.

syslog-gollector is a Syslog Collector (sometimes called a Syslog Server), written in Go (golang), which has support for writing received log messages to Apache Kafka, version 0.8. Log messages can be written to Kafka in parsed format, or written exactly as received.

The logs lines must be RFC5424 compliant, and in the following format:

<PRI>VERSION TIMESTAMP HOSTNAME APP-NAME PROC-ID MSGID MSG"

Consult the RFC to learn what each of these fields is. The TIMESTAMP field must be in RFC3339 format. Lines not matching this format are dropped by the syslog-gollector.

Check out the "Running" section for hints on how to easily configure Syslog clients to emit log mesages in the right format.

Multi-line Support

The syslog-gollector supports multi-line log messages, so messages such as stack traces will be considered a single log message.

Parsing Mode

Parsing mode is enabled by default. In this mode, the Syslog header is parsed, and the fields become keys in a JSON structure. This JSON structure is then written to Kafka. If parsing mode is not enabled, the log line is written to Kafka as it was received.

For example, imagine the following log line is received by the syslog-gollector:

<134>1 2013-09-04T10:25:52.618085 ubuntu sshd 1999 - password accepted for user root

With parsing disabled, the line is written as-is to Kafka. With parsing enabled, the following JSON object is instead written to Kafka:

{
    "priority":134,
    "version":1,
    "timestamp":"2013-09-04T10:25:52.618085",
    "host":"ubuntu",
    "app":"sshd",
    "pid":1999,
    "msgid": "-",
    "message": "password accepted for user root"
}

This parsed form may be useful to downstream consumers.

Building

Tested on 64-bit Kubuntu 14.04.

mkdir ~/syslog-gollector # Or a directory of your choice.
cd ~/syslog-gollector
export GOPATH=$PWD
go get github.com/otoolep/syslog-gollector

To run the tests execute:

go get gopkg.in/check.v1
go test github.com/otoolep/syslog-gollector/...

If you want to hack on the source then modify it and rebuild like so (or whatever your Go workflow is):

cd $GOPATH/github.com/otoolep/syslog-gollector
....hack, hack,....
go install

Running

The binary will be located in the $GOPATH/bin directory. Execute

syslog-gollector -h

for command-line options.

Make sure your Kafka cluster is up and running first. Point your syslog clients at the syslog-gollector, ensuring the log message format is what syslog-gollector expects. Both rsyslog and syslog-ng support templating, which make it easy to format messages correctly. For example, an rsyslog template looks like so:

$template SyslogGollector,"<%pri%>%protocol-version% %timestamp:::date-rfc3339% %HOSTNAME% %app-name% %procid% - %msg%"

syslog-ng looks like so:

template SyslogGollector { template("<${PRI}>1 ${ISODATE} ${HOST} ${PROGRAM} ${PID} - $MSG"); template_escape(no) };

Admin Control

The syslog-gollector exposes a number of HTTP endpoints, for general statistics and diagnostics. This Admin server runs on localhost:8080 by default.

/statistics
/diagnostics

Adding the query parameter pretty to the URL will produce pretty-printed output. For example:

curl 'localhost:8080/statistics?pretty'

TODO

This code is still work-in-progress, and issues are being tracked. Other key tasks that span multiple issues include:

  • Throughput needs to be measured.
  • Run the program through Go's race-detector.
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].