https://github.com/icha024/go-collect-logs
Lightweight tool to collect remote syslogs in-memory and display on web console
https://github.com/icha024/go-collect-logs
collect golang syslog web
Last synced: 5 months ago
JSON representation
Lightweight tool to collect remote syslogs in-memory and display on web console
- Host: GitHub
- URL: https://github.com/icha024/go-collect-logs
- Owner: icha024
- License: epl-1.0
- Created: 2017-06-20T13:10:13.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-22T22:01:23.000Z (almost 9 years ago)
- Last Synced: 2024-06-20T14:30:16.343Z (about 2 years ago)
- Topics: collect, golang, syslog, web
- Language: Go
- Homepage:
- Size: 145 KB
- Stars: 5
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
# Go Collect Logs
Lightweight tool to collect syslogs (RFC3164 & RFC5424) in-memory then display them on a web console for easy viewing/searching.
## Build and run
To build
```
go get github.com/icha024/go-collect-logs
cd go-collect-logs
go build
```
To run, just `./go-collect-logs`
```
Usage of ./go-collect-logs:
-host string
Service host to listen on. (default "0.0.0.0")
-log-read-inteval int
Interval, in seconds, to read syslog into memory. (default 3)
-max-filter int
Maximum number of filtered log entries to return. (default 1000)
-max-log int
Maximum number of log entries to keep. Approx 1KB/entry. (default 50000)
-port int
Service port to listen on. (default 3000)
-sev
Parse the syslog severity header
-stdout
Print syslog received to stdout (default true)
-syslog-host string
Syslog host to listen on. (default "0.0.0.0")
-syslog-port int
Syslog port to listen on. (default 10514)
```
## Running in Docker:
See instructions on Docker hub:
https://hub.docker.com/r/icha024/go-collect-logs/
To build your own:
```
docker build -t go-collect-logs
docker run --rm -ti -p 3000:3000 -p 10514:10514/UDP -p 10514:10514/TCP go-collect-logs
```
## Sending logs to go-collect-logs:
```
echo 'test message' 2>&1 | logger -P 10514 -n localhost
```
or redirect from your existing Docker container:
```
docker run --rm -ti --log-driver=syslog --log-opt syslog-format=rfc3164 --log-opt syslog-address=udp://127.0.0.1:10514 alpine /bin/sh -c "while true; do echo My Message \$RANDOM; sleep 1; done;"
```
(See piping Docker logs to syslog: https://docs.docker.com/engine/admin/logging/overview/)
## View logs on web console
Open http://127.0.0.1:3000
