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