Skip to content

Commit

Permalink
Adding fixes for syslog config to el8 and el9
Browse files Browse the repository at this point in the history
  • Loading branch information
DBezemer committed Apr 16, 2024
1 parent 7401f0b commit 7cf2985
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
23 changes: 13 additions & 10 deletions SOURCES/haproxy.syslog.el8
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ $UDPServerRun 514
$template HAProxy,"%TIMESTAMP% %syslogseverity-text:::UPPERCASE%: %msg:::drop-last-lf%\n"
$template HAProxyAccess,"%msg%\n"

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
if ($programname startswith 'haproxy' and $inputname == 'imudp') 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
}
}
23 changes: 13 additions & 10 deletions SOURCES/haproxy.syslog.el9
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ $UDPServerRun 514
$template HAProxy,"%TIMESTAMP% %syslogseverity-text:::UPPERCASE%: %msg:::drop-last-lf%\n"
$template HAProxyAccess,"%msg%\n"

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
if ($programname startswith 'haproxy' and $inputname == 'imudp') 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
}
}

0 comments on commit 7cf2985

Please sign in to comment.