Skip to content

Instantly share code, notes, and snippets.

@kamermans
Last active April 24, 2018 01:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save kamermans/3a999f3dd727f8ebfcf3 to your computer and use it in GitHub Desktop.
Save kamermans/3a999f3dd727f8ebfcf3 to your computer and use it in GitHub Desktop.
RainerScript version of /etc/rsyslog.conf for Ubuntu with rsyslog 8+
# /etc/rsyslog.conf Configuration file for rsyslog.
#
# For more information see
# /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html
#
# Default logging rules can be found in /etc/rsyslog.d/50-default.conf
#
# WARNING: This config has been converted to RainerScript format which could
# affect config files provided by other software in /etc/rsyslog.d/
# It should behave the same as the legacy-format config file that ships
# with Ubuntu 14.04.1 rsyslog 7.4.4
# The default Ubuntu file /etc/rsyslog.d/50-default.conf does not need to be
# modified, as it is already in the preferred format
#
# You should be using rsyslog v8 or higher with this config
# You can install rsyslog v8 on Ubuntu 14.04 like this:
# sudo add-apt-repository ppa:adiscon/v8-stable
# sudo apt-get update
# sudo apt-get install rsyslog
###########################
#### GLOBAL DIRECTIVES ####
###########################
$PrivDropToUser syslog
$PrivDropToGroup syslog
# Filter duplicated messages
$RepeatedMsgReduction on
#
# Where to place spool files
#
$WorkDirectory /var/spool/rsyslog
# Global umask for all actions
$umask 0022
#################
#### MODULES ####
#################
# Stats logging must be first if you want it enabled
# You probably want to tell logrotate about this file
#module( load="impstats"
# interval="300"
# severity="7"
# log.syslog="off"
# log.file="/var/log/rsyslog-stats.log"
#)
# Provides local system logging
module(load="imuxsock")
input( type="imuxsock" socket="/dev/log")
# Provides kernel logging support (previously done by rklogd)
module(load="imklog" permitNonKernelFacility="on")
# Provides --MARK-- message capability
#module(load="immark")
# Provides UDP syslog reception
#module(load="imudp")
#input( type="imudp" port="514")
# Provides TCP syslog reception
#module(load="imtcp")
#input( type="imtcp" port="514")
module( load="builtin:omfile"
# Use traditional timestamp format.
# To enable high precision timestamps, use the following line:
# template="RSYSLOG_FileFormat"
template="RSYSLOG_TraditionalFileFormat"
# Set the default permissions for all log files.
fileOwner="syslog"
fileGroup="adm"
dirOwner="syslog"
dirGroup="adm"
fileCreateMode="0640"
dirCreateMode="0755"
)
########################
#### INCLUDED FILES ####
########################
#
# Include all config files in /etc/rsyslog.d/
#
$IncludeConfig /etc/rsyslog.d/*.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment