From 43bebb8332c37dc4dea883d5ff0bb2c0fac5e36c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Bj=C3=B6rklund?= Date: Fri, 21 Feb 2025 12:13:48 +0100 Subject: [PATCH] rsyslog server: add rule to log each host to it's own logfile --- .../modules/soc/templates/rsyslog/rsyslog-local.conf.erb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/global/overlay/etc/puppet/modules/soc/templates/rsyslog/rsyslog-local.conf.erb b/global/overlay/etc/puppet/modules/soc/templates/rsyslog/rsyslog-local.conf.erb index 88993ec..3b68160 100644 --- a/global/overlay/etc/puppet/modules/soc/templates/rsyslog/rsyslog-local.conf.erb +++ b/global/overlay/etc/puppet/modules/soc/templates/rsyslog/rsyslog-local.conf.erb @@ -19,3 +19,9 @@ input( maxDataSize="10k" oversizeMode="truncate") <% end -%> + +# Split remote hosts to separate logs for easier reading +# make sure local logs still are sent to default files +$template RemoteHost,"/var/log/remote/%HOSTNAME%/syslog.log +if ($fromhost-ip != "127.0.0.1") then ?RemoteHost +& ~