Skip to content

Instantly share code, notes, and snippets.

@johnxx
Created May 6, 2016 00:54
Show Gist options
  • Save johnxx/604b99ca560aff7e93f237166c11734a to your computer and use it in GitHub Desktop.
Save johnxx/604b99ca560aff7e93f237166c11734a to your computer and use it in GitHub Desktop.
Enabling rsyslog remote listening on Debian
--- rsyslog.conf.bak 2015-02-19 09:48:58.829059788 +0000
+++ rsyslog.conf 2015-03-12 00:33:46.052507878 +0000
@@ -20,6 +20,9 @@
#$ModLoad imtcp
#$InputTCPServerRun 514
+$ModLoad imrelp
+$InputRELPServerRun 10514
+
###########################
#### GLOBAL DIRECTIVES ####
@@ -55,6 +58,15 @@
#### RULES ####
###############
+# Handle logging for remote machines
+$template DynFacilityFile,"/var/log/hosts/%HOSTNAME%/%syslogfacility-text%.log"
+$template DynProgramFile,"/var/log/hosts/%HOSTNAME%/%programname%.log"
+$template DynSysLogFile,"/var/log/hosts/%HOSTNAME%/syslog"
+if $source != 'loghost' and $programname contains 'myprog' then ?DynProgramFile
+:source, !isequal, "localhost" ?DynFacilityFile
+:source, !isequal, "localhost" ?DynSysLogFile
+:source, !isequal, "localhost" ~
+
#
# First some standard log files. Log by facility.
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment