-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rsyslog_client.conf
80 lines (62 loc) · 2.43 KB
/
Rsyslog_client.conf
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
77
78
79
80
# /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 imklog # provides kernel logging support (previously done by rklogd)
#$ModLoad immark # provides --MARK-- message capability
$ModLoad imfile
#### TLS rsyslog certificates ####
# certificate files
$DefaultNetstreamDriverCAFile /home/ubuntu/rsyslogTLS/ca.pem
$DefaultNetstreamDriverCertFile /home/ubuntu/rsyslogTLS/cert.pem
$DefaultNetstreamDriverKeyFile /home/ubuntu/rsyslogTLS/key.pem
###########################
#### 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 root
$FileGroup admin
$FileCreateMode 0777
$DirCreateMode 0755
#
# Where to place spool files
#
$WorkDirectory /var/spool/rsyslog
#
# Include all config files in /etc/rsyslog.d/
#
$IncludeConfig /etc/rsyslog.d/*.conf
#if($msg contains_i "TRAFFIC") then{
# action(name="firewallLog" type="omfwd" protocol="tcp" target="kafkasrv" port="555" template="ForwardToRsyslogServerFormatTemplate" StreamDriver="gtls" StreamDriverMode="1" StreamDriverAuthMode="x509/certvalid")
#}
if($msg contains_i "TRAFFIC") then{
action(name="log" type="omfwd" protocol="tcp" target="5.5.5.5" port="5555" template="ForwardToRsyslogServerFormatTemplate" StreamDriver="gtls" StreamDriverMode="1" StreamDriverAuthMode="x509/certvalid")
}
###### SSL TRAFFIC #######
#read from the ssl log file and assign the tag "ssl" for its messages
#$InputFileName /home/ubuntu/ssltrafcapt/capturessl
#$InputFileTag ssltraffic
input(type="imfile"
File="/home/traffic"
deleteStateOnFileDelete="on"
reopenOnTruncate="on"
Tag="traffic")
#send ssl traffic to kafka server on port 5555
#if($syslogtag=="traffic") then @@5.5.5.5:5555;ForwardToRsyslogServerFormatTemplate
if($syslogtag=="traffic") then{
action(name="sslLog" type="omfwd" protocol="tcp" target="5.5.5.5" port="5555" template="ForwardToRsyslogServerFormatTemplate" StreamDriver="gtls" StreamDriverMode="1" StreamDriverAuthMode="x509/certvalid")
}