#  /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


#################
#### MODULES ####
#################

$ModLoad imuxsock # provides support for local system logging
$ModLoad imklog   # provides kernel logging support (previously done by rklogd)
# $ModLoad immark  # provides --MARK-- message capability
$ModLoad ommysql  # connect rsyslog with mysql

# provides UDP syslog reception
# $ModLoad imudp
# $UDPServerRun 514

# provides TCP syslog reception
# $ModLoad imtcp
# $InputTCPServerRun 514


###########################
#### GLOBAL DIRECTIVES ####
###########################

#
# Use traditional timestamp format.
# To enable high precision timestamps, comment out the following line.
#
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat

# Filter duplicated messages
$RepeatedMsgReduction on

#
# Set the default permissions for all log files.
#
$FileOwner syslog
$FileGroup adm
$FileCreateMode 0644
$DirCreateMode 0755
$Umask 0022
$PrivDropToUser syslog
$PrivDropToGroup syslog

#
# Where to place spool files
#
$WorkDirectory /var/spool/rsyslog

#
# Include all config files in /etc/rsyslog.d/
#
$IncludeConfig /etc/rsyslog.d/*.conf

$template DailyLogs,"/var/log/iptables/%$YEAR%/%$MONTH%/%$DAY%_%$MONTH%_%$YEAR%_iptables.log"

$template SquidTemplate,"%$day%/%timegenerated:1:3:date-rfc3164%/%$year%,%timegenerated:12:23:date-rfc3339%,%HOSTNAME%,%syslogtag%,%msg%\n"

$template SquidDailyLogs,"/var/log/squid/%$YEAR%/%$MONTH%/%$DAY%_%$MONTH%_%$YEAR%_squid.log"

# kern.=debug -/var/log/iptables/iptables.log
kern.=debug  -?Dailylog  

kern.*;kern.!=debug -/var/log/kern.log

local0.*            -?SquidDailyLogs;SquidTemplate

# local0.*            :ommysql:localhost,Syslog,rsyslog,123456
local0.*     action(type="ommysql" server="127.0.0.1" serverport="3306" db="Logs_Managements" uid="userlog" pwd="123456")


RSYSLOGD_OPTIONS="-c4 -6"
