From 517cd72efda02fde70e24524b1085ab8ceb62989 Mon Sep 17 00:00:00 2001 From: David Bezemer Date: Tue, 21 Apr 2020 17:11:17 +0200 Subject: [PATCH] Fix default included syslog entries - Resolved issue with all messages in /var/log/messages missing on CentOS/RHEL 7.x and 8.x --- SOURCES/haproxy.syslog.amzn1 | 11 +++++++++++ SOURCES/haproxy.syslog.amzn2 | 11 +++++++++++ SOURCES/haproxy.syslog.el6 | 4 ++-- SOURCES/haproxy.syslog.el7 | 15 +++++++++++---- 4 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 SOURCES/haproxy.syslog.amzn1 create mode 100644 SOURCES/haproxy.syslog.amzn2 diff --git a/SOURCES/haproxy.syslog.amzn1 b/SOURCES/haproxy.syslog.amzn1 new file mode 100644 index 0000000..da5b5a8 --- /dev/null +++ b/SOURCES/haproxy.syslog.amzn1 @@ -0,0 +1,11 @@ +$ModLoad imudp +$UDPServerAddress 127.0.0.1 +$UDPServerRun 514 + +$template HAProxy,"%TIMESTAMP% %syslogseverity-text:::UPPERCASE%: %msg%\n" +$template HAProxyAccess,"%msg%\n" + +local2.=info /var/log/haproxy/access.log;HAProxyAccess +local2.error /var/log/haproxy/error.log;HAProxy +local2.* /var/log/haproxy/status.log +& ~ \ No newline at end of file diff --git a/SOURCES/haproxy.syslog.amzn2 b/SOURCES/haproxy.syslog.amzn2 new file mode 100644 index 0000000..2711074 --- /dev/null +++ b/SOURCES/haproxy.syslog.amzn2 @@ -0,0 +1,11 @@ +$ModLoad imudp +$UDPServerAddress 127.0.0.1 +$UDPServerRun 514 + +$template HAProxy,"%TIMESTAMP% %syslogseverity-text:::UPPERCASE%: %msg%\n" +$template HAProxyAccess,"%msg%\n" + +local2.=info /var/log/haproxy/access.log;HAProxyAccess +local2.error /var/log/haproxy/error.log;HAProxy +local2.* /var/log/haproxy/status.log +local2.* stop \ No newline at end of file diff --git a/SOURCES/haproxy.syslog.el6 b/SOURCES/haproxy.syslog.el6 index 46ee067..da5b5a8 100644 --- a/SOURCES/haproxy.syslog.el6 +++ b/SOURCES/haproxy.syslog.el6 @@ -6,6 +6,6 @@ $template HAProxy,"%TIMESTAMP% %syslogseverity-text:::UPPERCASE%: %msg%\n" $template HAProxyAccess,"%msg%\n" local2.=info /var/log/haproxy/access.log;HAProxyAccess -local2.=notice;local2.=warning /var/log/haproxy/status.log;HAProxy local2.error /var/log/haproxy/error.log;HAProxy -local2.* ~ \ No newline at end of file +local2.* /var/log/haproxy/status.log +& ~ \ No newline at end of file diff --git a/SOURCES/haproxy.syslog.el7 b/SOURCES/haproxy.syslog.el7 index cd1abc1..05d1337 100644 --- a/SOURCES/haproxy.syslog.el7 +++ b/SOURCES/haproxy.syslog.el7 @@ -5,7 +5,14 @@ $UDPServerRun 514 $template HAProxy,"%TIMESTAMP% %syslogseverity-text:::UPPERCASE%: %msg:::drop-last-lf%\n" $template HAProxyAccess,"%msg%\n" -local2.=info if $programname startswith 'haproxy' then /var/log/haproxy/access.log;HAProxyAccess -local2.emerg if $programname startswith 'haproxy' then /var/log/haproxy/error.log;HAProxy -local2.notice if $programname startswith 'haproxy' then /var/log/haproxy/status.log;HAProxy -local2.* & stop \ No newline at end of file +if $programname startswith 'haproxy' then { + if $syslogseverity == 6 then + action(type="omfile" file="/var/log/haproxy/access.log" template="HAProxyAccess") + stop + if $syslogseverity <= 3 then + action(type="omfile" file="/var/log/haproxy/error.log" template="HAProxy") + stop + if $syslogseverity <= 5 then + action(type="omfile" file="/var/log/haproxy/status.log" template="HAProxy") + stop +} \ No newline at end of file