diff --git a/SOURCES/haproxy.syslog.amzn1 b/SOURCES/haproxy.syslog.amzn1 index 67ae16d..da5b5a8 100644 --- a/SOURCES/haproxy.syslog.amzn1 +++ b/SOURCES/haproxy.syslog.amzn1 @@ -2,10 +2,10 @@ $ModLoad imudp $UDPServerAddress 127.0.0.1 $UDPServerRun 514 -$template HAProxy,"%syslogtag%%msg:::drop-last-lf%\n" -$template TraditionalFormatWithPRI,"%pri-text%: %timegenerated% %syslogtag%%msg:::drop-last-lf%\n" +$template HAProxy,"%TIMESTAMP% %syslogseverity-text:::UPPERCASE%: %msg%\n" +$template HAProxyAccess,"%msg%\n" -local2.=info /var/log/haproxy/access.log;HAProxy -local2.=notice;local2.=warning /var/log/haproxy/status.log;TraditionalFormatWithPRI -local2.error /var/log/haproxy/error.log;TraditionalFormatWithPRI -local2.* ~ +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 index 4ee7bf2..2711074 100644 --- a/SOURCES/haproxy.syslog.amzn2 +++ b/SOURCES/haproxy.syslog.amzn2 @@ -2,10 +2,10 @@ $ModLoad imudp $UDPServerAddress 127.0.0.1 $UDPServerRun 514 -$template HAProxy,"%syslogtag%%msg:::drop-last-lf%\n" -$template TraditionalFormatWithPRI,"%pri-text%: %timegenerated% %syslogtag%%msg:::drop-last-lf%\n" +$template HAProxy,"%TIMESTAMP% %syslogseverity-text:::UPPERCASE%: %msg%\n" +$template HAProxyAccess,"%msg%\n" -local2.=info /var/log/haproxy/access.log;HAProxy -local2.=notice;local2.=warning /var/log/haproxy/status.log;TraditionalFormatWithPRI -local2.error /var/log/haproxy/error.log;TraditionalFormatWithPRI +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 1b03d95..da5b5a8 100644 --- a/SOURCES/haproxy.syslog.el6 +++ b/SOURCES/haproxy.syslog.el6 @@ -2,10 +2,10 @@ $ModLoad imudp $UDPServerAddress 127.0.0.1 $UDPServerRun 514 -$template HAProxy,"%syslogtag%%msg:::drop-last-lf%\n" -$template TraditionalFormatWithPRI,"%pri-text%: %timegenerated% %syslogtag%%msg:::drop-last-lf%\n" +$template HAProxy,"%TIMESTAMP% %syslogseverity-text:::UPPERCASE%: %msg%\n" +$template HAProxyAccess,"%msg%\n" -local2.=info /var/log/haproxy/access.log;HAProxy -local2.=notice;local2.=warning /var/log/haproxy/status.log;TraditionalFormatWithPRI -local2.error /var/log/haproxy/error.log;TraditionalFormatWithPRI -local2.* ~ \ No newline at end of file +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.el7 b/SOURCES/haproxy.syslog.el7 index 4ee7bf2..05d1337 100644 --- a/SOURCES/haproxy.syslog.el7 +++ b/SOURCES/haproxy.syslog.el7 @@ -2,10 +2,17 @@ $ModLoad imudp $UDPServerAddress 127.0.0.1 $UDPServerRun 514 -$template HAProxy,"%syslogtag%%msg:::drop-last-lf%\n" -$template TraditionalFormatWithPRI,"%pri-text%: %timegenerated% %syslogtag%%msg:::drop-last-lf%\n" +$template HAProxy,"%TIMESTAMP% %syslogseverity-text:::UPPERCASE%: %msg:::drop-last-lf%\n" +$template HAProxyAccess,"%msg%\n" -local2.=info /var/log/haproxy/access.log;HAProxy -local2.=notice;local2.=warning /var/log/haproxy/status.log;TraditionalFormatWithPRI -local2.error /var/log/haproxy/error.log;TraditionalFormatWithPRI -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