Created
February 15, 2024 03:53
-
-
Save samveen/87f91b850bae64d6b70378f1f42a94a5 to your computer and use it in GitHub Desktop.
Remote logging configuration for rsyslog v8 on Debian Bookworm (Use case: Pi as log host for router). Place in /etc/rsyslog.d/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remote logging config for rsyslog | |
# Load modules (UDP,TCP) | |
module(load="imudp") | |
module(load="imtcp") | |
# Configuration for the modules | |
input(type="imudp" port="514" ruleset="writeRemoteData") | |
input(type="imtcp" port="514" ruleset="writeRemoteData") | |
# Save remote logs | |
ruleset(name="writeRemoteData") { | |
action(type="omfile" dynaFile="RemoteLogs") | |
} | |
# Log filename template | |
template(name="RemoteLogs" type="string" string="/var/log/%HOSTNAME%/%PROGRAMNAME%.log") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment