Skip to content

Instantly share code, notes, and snippets.

@samveen
Created February 15, 2024 03:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samveen/87f91b850bae64d6b70378f1f42a94a5 to your computer and use it in GitHub Desktop.
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/
# 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