Created
November 17, 2017 05:10
-
-
Save jwineinger/68021d73189b70fca63a17c6d88c5669 to your computer and use it in GitHub Desktop.
syslog-ng sidecar to send log messages to AWS CloudWatch Logs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# syslog-ng.conf | |
@version: 3.12 | |
options { chain_hostnames(off); flush_lines(0); use_dns(no); use_fqdn(no); | |
owner("root"); group("adm"); perm(0640); stats_freq(0); | |
bad_hostname("^gconfd$"); | |
}; | |
source s_src { | |
network( | |
transport("udp") | |
port(514) | |
); | |
network( | |
transport("tcp") | |
port(601) | |
); | |
}; | |
destination d_out{ | |
file("/dev/stdout" template("${MESSAGE}\n")); | |
}; | |
log{ | |
source(s_src); | |
destination (d_out); | |
}; | |
#### | |
docker run -it \ | |
-v "$PWD/syslog-ng.conf":/etc/syslog-ng/syslog-ng.conf \ | |
-p 514:514/udp \ | |
-p 601:601 \ | |
--rm \ | |
--name syslog-ng \ | |
--log-driver=awslogs | |
--log-opt awslogs-region=us-east-1 | |
--log-opt awslogs-group=my-apps | |
--log-opt awslogs-stream={{ app_version }}-mycontainer-{{ ec2_instance_id }} | |
balabit/syslog-ng:latest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment