docker-syslog-forwarder/README.md

62 lines
1.6 KiB
Markdown
Raw Permalink Normal View History

2022-05-22 17:13:40 +00:00
# docker-syslog-forwarder
[![Build Status](https://drone.asperti.com/api/badges/paspo/docker-syslog-forwarder/status.svg)](https://drone.asperti.com/paspo/docker-syslog-forwarder)
This container accepts syslog streams on port `514/tcp` and `514/udp` and forwards everything to a remote syslog server in RFC5424 format.
No encryption support at the moment.
## build
```bash
docker build . -t docker.asperti.com/paspo/syslog-forwarder
```
## environment
Variable | Default | Description
2023-07-07 15:44:45 +00:00
--------------|-----------|----------------------------------------------------
2022-05-22 17:13:40 +00:00
TARGET_HOST | 127.0.0.1 | target server IP/hostname
TARGET_PROTO | tcp | `tcp` or `udp`
TARGET_PORT | 514 | target server syslog port
2023-07-07 15:44:45 +00:00
DEBUG | 0 | if != 0, every received log line is shown on stdout
2022-05-22 17:13:40 +00:00
2023-07-07 15:48:46 +00:00
## extra config files
You can add some custom config file, by mounting the `/extraconfig` directory. Any file ending in `.conf` placed here will be added to rsyslog configuration.
2022-05-22 17:13:40 +00:00
## run
```bash
docker run -d --name syslog-forwarder \
-p 514:514/tcp -p 514:514/udp \
-e "TARGET_HOST=192.168.1.33" \
docker.asperti.com/paspo/syslog-forwarder
```
## docker-compose
```yaml
version: "3"
services:
syslog-forwarder:
image: docker.asperti.com/paspo/syslog-forwarder
restart: always
ports:
- "514:514/tcp"
- "514:514/udp"
environment:
- TARGET_HOST=192.168.1.33
- TARGET_PROTO=tcp
- TARGET_PORT=1514
```
2022-05-22 19:23:09 +00:00
## testing
If you need a log source for testing, you can use the `logger` command:
```bash
logger --server my.logserver.com --tcp --rfc3164 --priority 3 --port 514 "ciao"
```