1
+ ###############################################################################
2
+ # Managed by Ansible
3
+ # file: ansible/roles/acs/templates/rsyslog.conf.j2
4
+ ###############################################################################
5
+ #
6
+ # /etc/rsyslog.conf Configuration file for rsyslog.
7
+ #
8
+ # For more information see
9
+ # /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html
10
+
11
+
12
+ #################
13
+ #### MODULES ####
14
+ #################
15
+
16
+ $ModLoad imuxsock # provides support for local system logging
17
+ $ModLoad imklog # provides kernel logging support
18
+ #$ModLoad immark # provides --MARK-- message capability
19
+
20
+ # provides UDP syslog reception
21
+ $ModLoad imudp
22
+ $UDPServerAddress 127.0.0.1 #bind to localhost before udp server run
23
+ $UDPServerRun 514
24
+
25
+ # provides TCP syslog reception
26
+ #$ModLoad imtcp
27
+ #$InputTCPServerRun 514
28
+
29
+
30
+ ###########################
31
+ #### GLOBAL DIRECTIVES ####
32
+ ###########################
33
+ #
34
+ # Use traditional timestamp format.
35
+ # To enable high precision timestamps, comment out the following line.
36
+ #
37
+ #$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
38
+
39
+ # Define a custom template
40
+ $template SONiCFileFormat,"%timegenerated%.%timegenerated:::date-subseconds% %HOSTNAME% %syslogseverity-text:::uppercase% %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n"
41
+ $ActionFileDefaultTemplate SONiCFileFormat
42
+
43
+ template(name="WelfRemoteFormat" type="string" string="%TIMESTAMP% id=firewall time=\"%timereported\
44
+ :::date-year%-%timereported:::date-month%-%timereported:::date-day% %timereported:::date-hour%:%timereported:::date-minute%:%timereported\
45
+ :::date-second%\" fw=\"sonic\" pri=%syslogpriority% msg=\"%syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\"\n")
46
+
47
+ #Set remote syslog server
48
+ *.notice
49
+ action(type="omfwd" Target="1.1.1.1" Port="514" Protocol="udp" Device="eth0" Template="SONiCFileFormat")
50
+
51
+ #
52
+ # Set the default permissions for all log files.
53
+ #
54
+ $FileOwner root
55
+ $FileGroup adm
56
+ $FileCreateMode 0640
57
+ $DirCreateMode 0755
58
+ $Umask 0022
59
+
60
+ #
61
+ # Where to place spool and state files
62
+ #
63
+ $WorkDirectory /var/spool/rsyslog
64
+
65
+ #
66
+ # Include all config files in /etc/rsyslog.d/
67
+ #
68
+ $IncludeConfig /etc/rsyslog.d/*.conf
69
+
70
+ #
71
+ # Suppress duplicate messages and report "message repeated n times"
72
+ #
73
+ $RepeatedMsgReduction on
74
+
75
+ ###############
76
+ #### RULES ####
77
+ ###############
0 commit comments