Theo Chatzimichos f46ac3
# Managed by Salt
Theo Chatzimichos f46ac3
##
Theo Chatzimichos f46ac3
## === When you're using remote logging, enable on-disk queues ===  
Theo Chatzimichos f46ac3
## === in rsyslog.d/remote.conf. When neccesary also set the   ===
Theo Chatzimichos f46ac3
## === SYSLOG_REQUIRES_NETWORK=yes in /etc/sysconfig/syslog,   ===
Theo Chatzimichos f46ac3
## === e.g. when rsyslog has to receive on a specific IP only. ===
Theo Chatzimichos f46ac3
##
Theo Chatzimichos f46ac3
## Note, that when the MYSQL, PGSQL, GSSAPI, GnuTLS or SNMP modules
Theo Chatzimichos f46ac3
## (provided in separate rsyslog-module-* packages) are enabled, the
Theo Chatzimichos f46ac3
## configuration can't be used on a system with /usr on a remote
Theo Chatzimichos f46ac3
## filesystem, except on newer systems where initrd mounts /usr.
Theo Chatzimichos f46ac3
## [The modules are linked against libraries installed bellow of
Theo Chatzimichos f46ac3
##  /usr thus also installed in /usr/lib*/rsyslog because of this.]
Theo Chatzimichos f46ac3
##
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
#
Theo Chatzimichos f46ac3
# if you experience problems, check
Theo Chatzimichos f46ac3
# http://www.rsyslog.com/troubleshoot for assistance
Theo Chatzimichos f46ac3
# and report them at http://bugzilla.novell.com/
Theo Chatzimichos f46ac3
#
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
# since rsyslog v3: load input modules
Theo Chatzimichos f46ac3
# If you do not load inputs, nothing happens!
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
# provides --MARK-- message capability (every 1 hour)
Theo Chatzimichos f46ac3
$ModLoad immark.so
Theo Chatzimichos f46ac3
$MarkMessagePeriod      3600
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
# provides support for local system logging (e.g. via logger command)
Theo Chatzimichos f46ac3
$ModLoad imuxsock.so
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
# reduce dupplicate log messages (last message repeated n times)
Theo Chatzimichos f46ac3
$RepeatedMsgReduction   on
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
# kernel logging (may be also provided by /sbin/klogd)
Theo Chatzimichos f46ac3
# see also http://www.rsyslog.com/doc-imklog.html.
Theo Chatzimichos f46ac3
$ModLoad imklog.so
Theo Chatzimichos f46ac3
# set log level 1 (same as in /etc/sysconfig/syslog).
Theo Chatzimichos f46ac3
$klogConsoleLogLevel    1
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
# Use rsyslog native, rfc5424 conform log format as default
Theo Chatzimichos f46ac3
# ($ActionFileDefaultTemplate RSYSLOG_FileFormat).
Theo Chatzimichos f46ac3
#
Theo Chatzimichos f46ac3
# To change a single file to use obsolete BSD syslog format
Theo Chatzimichos f46ac3
# (rfc 3164, no high-precision timestamps), set the variable
Theo Chatzimichos f46ac3
# bellow or append ";RSYSLOG_FileFormat" to the filename.
Theo Chatzimichos f46ac3
# See
Theo Chatzimichos f46ac3
#   http://www.rsyslog.com/doc/rsyslog_conf_templates.html
Theo Chatzimichos f46ac3
# for more informations.
Theo Chatzimichos f46ac3
#
Theo Chatzimichos f46ac3
#$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
#
Theo Chatzimichos f46ac3
# Include config generated by /etc/init.d/syslog script
Theo Chatzimichos f46ac3
# using the SYSLOGD_ADDITIONAL_SOCKET* variables in the
Theo Chatzimichos f46ac3
# /etc/sysconfig/syslog file.
Theo Chatzimichos f46ac3
#
Theo Chatzimichos f46ac3
$IncludeConfig /run/rsyslog/additional-log-sockets.conf
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
#
Theo Chatzimichos f46ac3
# Include config files, that the admin provided? :
Theo Chatzimichos f46ac3
#
Theo Chatzimichos f46ac3
$IncludeConfig /etc/rsyslog.d/*.conf
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
###
Theo Chatzimichos f46ac3
# print most important on tty10 and on the xconsole pipe
Theo Chatzimichos f46ac3
#
Theo Chatzimichos f46ac3
if	( \
Theo Chatzimichos f46ac3
	    /* kernel up to warning except of firewall  */ \
Theo Chatzimichos f46ac3
	    ($syslogfacility-text == 'kern')      and      \
Theo Chatzimichos f46ac3
	    ($syslogseverity <= 4 /* warning */ ) and not  \
Theo Chatzimichos f46ac3
	    ($msg contains 'IN=' and $msg contains 'OUT=') \
Theo Chatzimichos f46ac3
	) or ( \
Theo Chatzimichos f46ac3
	    /* up to errors except of facility authpriv */ \
Theo Chatzimichos f46ac3
	    ($syslogseverity <= 3 /* errors  */ ) and not  \
Theo Chatzimichos f46ac3
	    ($syslogfacility-text == 'authpriv')           \
Theo Chatzimichos f46ac3
	) \
Theo Chatzimichos f46ac3
then {
Theo Chatzimichos f46ac3
	/dev/tty10
Theo Chatzimichos f46ac3
	|/dev/xconsole
Theo Chatzimichos f46ac3
}
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
# Emergency messages to everyone logged on (wall)
Theo Chatzimichos f46ac3
*.emerg					 :omusrmsg:*
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
# enable this, if you want that root is informed
Theo Chatzimichos f46ac3
# immediately, e.g. of logins
Theo Chatzimichos f46ac3
#*.alert				root
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
#
Theo Chatzimichos f46ac3
# firewall messages into separate file and stop their further processing
Theo Chatzimichos f46ac3
#
Theo Chatzimichos f46ac3
if	($syslogfacility-text == 'kern') and \
Theo Chatzimichos f46ac3
	($msg contains 'IN=' and $msg contains 'OUT=') \
Theo Chatzimichos f46ac3
then {
Theo Chatzimichos f46ac3
	-/var/log/firewall
Theo Chatzimichos f46ac3
	stop
Theo Chatzimichos f46ac3
}
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
#
Theo Chatzimichos f46ac3
# acpid messages into separate file and stop their further processing
Theo Chatzimichos f46ac3
#
Theo Chatzimichos f46ac3
# => all acpid messages for debuging (uncomment if needed):
Theo Chatzimichos f46ac3
#if	($programname == 'acpid' or $syslogtag == '[acpid]:') then \
Theo Chatzimichos f46ac3
#	-/var/log/acpid
Theo Chatzimichos f46ac3
#
Theo Chatzimichos f46ac3
# => up to notice (skip info and debug)
Theo Chatzimichos f46ac3
if	($programname == 'acpid' or $syslogtag == '[acpid]:') and \
Theo Chatzimichos f46ac3
	($syslogseverity <= 5 /* notice */) \
Theo Chatzimichos f46ac3
then {
Theo Chatzimichos f46ac3
	-/var/log/acpid
Theo Chatzimichos f46ac3
	stop
Theo Chatzimichos f46ac3
}
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
#
Theo Chatzimichos f46ac3
# NetworkManager into separate file and stop their further processing
Theo Chatzimichos f46ac3
#
Theo Chatzimichos f46ac3
if      ($programname == 'NetworkManager') or \
Theo Chatzimichos f46ac3
	($programname startswith 'nm-') \
Theo Chatzimichos f46ac3
then {
Theo Chatzimichos f46ac3
	-/var/log/NetworkManager
Theo Chatzimichos f46ac3
	stop
Theo Chatzimichos f46ac3
}
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
#
Theo Chatzimichos f46ac3
# email-messages
Theo Chatzimichos f46ac3
#
Theo Chatzimichos f46ac3
mail.*					-/var/log/mail
Theo Chatzimichos f46ac3
mail.info				-/var/log/mail.info
Theo Chatzimichos f46ac3
mail.warning				-/var/log/mail.warn
Theo Chatzimichos f46ac3
mail.err				 /var/log/mail.err
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
#
Theo Chatzimichos f46ac3
# news-messages
Theo Chatzimichos f46ac3
#
Theo Chatzimichos f46ac3
news.crit				-/var/log/news/news.crit
Theo Chatzimichos f46ac3
news.err				-/var/log/news/news.err
Theo Chatzimichos f46ac3
news.notice				-/var/log/news/news.notice
Theo Chatzimichos f46ac3
# enable this, if you want to keep all news messages
Theo Chatzimichos f46ac3
# in one file
Theo Chatzimichos f46ac3
#news.*					-/var/log/news.all
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
#
Theo Chatzimichos f46ac3
# Warnings in one file
Theo Chatzimichos f46ac3
#
Theo Chatzimichos f46ac3
*.=warning;*.=err			-/var/log/warn
Theo Chatzimichos f46ac3
*.crit					 /var/log/warn
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
#
Theo Chatzimichos f46ac3
# the rest in one file
Theo Chatzimichos f46ac3
#
Theo Chatzimichos f46ac3
*.*;mail.none;news.none			-/var/log/messages
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
#
Theo Chatzimichos f46ac3
# enable this, if you want to keep all messages
Theo Chatzimichos f46ac3
# in one file
Theo Chatzimichos f46ac3
#*.*					-/var/log/allmessages
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
#
Theo Chatzimichos f46ac3
# Some foreign boot scripts require local7
Theo Chatzimichos f46ac3
#
Theo Chatzimichos f46ac3
local0.*;local1.*			-/var/log/localmessages
Theo Chatzimichos f46ac3
local2.*;local3.*			-/var/log/localmessages
Theo Chatzimichos f46ac3
local4.*;local5.*			-/var/log/localmessages
Theo Chatzimichos f46ac3
local6.*;local7.*			-/var/log/localmessages
Theo Chatzimichos f46ac3
Theo Chatzimichos f46ac3
###