Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cirocosta/syslog-send
Send syslog messages using go's log/syslog package
https://github.com/cirocosta/syslog-send
go golang rsyslog syslog
Last synced: 18 days ago
JSON representation
Send syslog messages using go's log/syslog package
- Host: GitHub
- URL: https://github.com/cirocosta/syslog-send
- Owner: cirocosta
- Created: 2018-08-22T21:20:45.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-28T01:42:08.000Z (about 6 years ago)
- Last Synced: 2024-10-04T20:29:01.523Z (about 1 month ago)
- Topics: go, golang, rsyslog, syslog
- Language: Go
- Homepage: https://ops.tips
- Size: 48.8 KB
- Stars: 5
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-golang-repositories - syslog-send
README
# syslog-send
An example of how to use [Golang's `log/syslog` package](https://golang.org/pkg/log/syslog/) to send `syslog` messages to a particular syslog facility.
The repository also includes a sample Docker image that has an `rsyslog` server listening on port 514/udp forwarding any syslog messages sent to it to `stdout`.
## CLI
```
Usage:
syslog-send [OPTIONS] Message...Application Options:
--address= address of the syslog server (default: 127.0.0.1:514)
--transport= transport to use (tcp|udp) (default: udp)
--facility= name of the syslog facility to send msgs to (default: local0)
--severity= severity of the message (default: emerg)Help Options:
-h, --help Show this help message
```## Example
First, create the `rsyslog` server:
```sh
# The Makefile under the root of this repository
# contain a `docker-compose` file that builds the
# image at `./image` and then runs the container
# with the right port mapping in place.
make run# Send a message to the rsyslog installation using
# the default parameters.
syslog-send this is a message!# Check the logs from the rsyslog container to
# verify that we indeed received the message.
docker logs rsyslog
2018-08-22T20:08:59-04:00 Ciros-MacBook-Pro.local custom-tag[61273]: this is a message!
```