ansible-ops-management/templates/etc/rsyslog.d/receiver.conf.j2

20 lines
821 B
Django/Jinja

# Receive logs
# Logs will appear as /var/log/remote/hostname.example.com-{secure,messages}.log
module(load="imtcp")
module(load="imudp")
$AllowedSender UDP, {{ allowed_rsyslog_clients|join(', ') }}
$AllowedSender TCP, {{ allowed_rsyslog_clients|join(', ') }}
template(name="TmplAuth" type="string" string="/var/log/remote/%FROMHOST%-secure.log")
template(name="TmplMsg" type="string" string="/var/log/remote/%FROMHOST%-messages.log")
# Process the equivalent of /var/log/{messages,secure} on a given system
ruleset(name="remote_1_log"){
authpriv.* action(type="omfile" DynaFile="TmplAuth")
*.info;mail.none;authpriv.none;cron.none action(type="omfile" DynaFile="TmplMsg")
}
input(type="imtcp" port="514" ruleset="remote_1_log")
input(type="imudp" port="514" ruleset="remote_1_log")