summaryrefslogtreecommitdiffstats
path: root/extras/gluster-rsyslog-7.2.conf
blob: 8b2841543f4595c610465e3d82f88c9ca4397e2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
##### gluster.conf #####
#
## 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
$RepeatedMsgReduction on

$ModLoad mmjsonparse
*.* :mmjsonparse:

#
## 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 'mmcount'
##
## More info at http://www.rsyslog.com/doc/mmcount.html
#
#module(load="mmcount")
#action(type="mmcount" appname="glusterd" key="!gf_code") # count each value of gf_code of appname glusterd
#action(type="mmcount" appname="glusterfsd" key="!gf_code") # count each value of gf_code of appname glusterfsd
#action(type="mmcount" appname="glusterfs" key="!gf_code") # count each value of gf_code of appname glusterfs

template (name="Glusterfsd_dynLogFile" type="string" string="/var/log/glusterfs/bricks/%app-name%.log")
template (name="Gluster_dynLogFile" type="string" string="/var/log/glusterfs/%app-name%.log")

template(name="GLFS_template" type="list") {
   property(name="$!mmcount")
   constant(value="/")
   property(name="syslogfacility-text" caseConversion="upper")
   constant(value="/")
   property(name="syslogseverity-text" caseConversion="upper")
   constant(value=" ")
   constant(value="[")
   property(name="timereported" dateFormat="rfc3339")
   constant(value="] ")
   constant(value="[")
   property(name="$!gf_code")
   constant(value="] ")
   constant(value="[")
   property(name="$!gf_message")
   constant(value="] ")
   property(name="$!msg")
   constant(value="\n")
}

if $app-name contains 'glusterfsd' then {
   action(type="omfile"
          DynaFile="Glusterfsd_dynLogFile"
          Template="GLFS_template")
   stop
}

if $app-name contains 'gluster' then {
   action(type="omfile"
          DynaFile="Gluster_dynLogFile"
          Template="GLFS_template")
   stop
}

#
## send email for every 50th mmcount
#$ModLoad ommail
#if $app-name == 'glusterfsd' and $!mmcount <> 0 and $!mmcount % 50 == 0 then {
#   $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
#   :ommail:;RSYSLOG_SyslogProtocol23Format
#}
#