2013-08-09 17:21:56 +05:30
##### gluster.conf #####
2013-08-09 17:21:56 +05:30
#
## If you want to log every message to the log file instead of
## intelligently suppressing repeated messages, set off to
## RepeatedMsgReduction. This change requires rsyslog restart
## (eg. run 'service rsyslog restart')
#
#$RepeatedMsgReduction off
2013-08-09 17:21:56 +05:30
$RepeatedMsgReduction on
2013-08-09 17:21:56 +05:30
#
## The mmcount module provides the capability to count log messages by
## severity or json property of given app-name. The count value is added
## into the log message as json property named '$msgid'
#
2013-08-09 17:21:56 +05:30
$ModLoad mmcount
2013-08-09 17:21:56 +05:30
$mmcountKey gf_code # start counting value of gf_code
2013-08-09 17:21:56 +05:30
$template Glusterfsd_dynLogFile,"/var/log/glusterfs/bricks/%app-name%.log"
$template Gluster_dynLogFile,"/var/log/glusterfs/%app-name%.log"
$template GLFS_Template,"%msgid%/%syslogfacility-text:::uppercase%/%syslogseverity-text:::uppercase% [%TIMESTAMP:::date-rfc3339%] %msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n"
2013-08-09 17:21:56 +05:30
#
## Pass logs to mmcount if app-name is 'gluster'
#
2013-08-09 17:21:56 +05:30
if $app-name contains 'gluster' then :mmcount:
2013-08-09 17:21:56 +05:30
2013-08-09 17:21:56 +05:30
if $app-name contains 'glusterfsd' then ?Glusterfsd_dynLogFile;GLFS_Template
if $app-name contains 'gluster' and not ( $app-name contains 'glusterfsd' ) then ?Gluster_dynLogFile;GLFS_Template
2013-08-09 17:21:56 +05:30
#
## Sample configuration to send a email alert for every 50th mmcount
#
#$ModLoad ommail
#$ActionMailSMTPServer smtp.example.com
#$ActionMailFrom rsyslog@example.com
#$ActionMailTo glusteradmin@example.com
#$template mailSubject,"50th message of gf_code=9999 on %hostname%"
#$template mailBody,"RSYSLOG Alert\r\nmsg='%msg%'"
#$ActionMailSubject mailSubject
#$ActionExecOnlyOnceEveryInterval 30
#if $app-name == 'glusterfsd' and $msgid != 0 and $msgid % 50 == 0 \
#then :ommail:;RSYSLOG_SyslogProtocol23Format
#
#
## discard logs where app-name is 'gluster' as we processed already
#
2013-08-09 17:21:56 +05:30
if $app-name contains 'gluster' then ~