Hi all,
i want use rsyslog with mysql to store syslog events from a netasq firewall.
All work great if i use the default template.
I try to make one in order to extract data correctly but i have some problems.
this what i made :
rsyslog.conf :
#################
#### MODULES ####
#################
#$ModLoad imuxsock # provides support for local system logging
#$ModLoad imklog # provides kernel logging support (previously done by rklogd)
$ModLoad immark # provides --MARK-- message capability
$ModLoad ommysql.so #load the mysql output driver
# provides UDP syslog reception
$ModLoad imudp
$UDPServerRun 514
# provides TCP syslog reception
#$ModLoad imtcp
#$InputTCPServerRun 514
###########################
#### GLOBAL DIRECTIVES ####
###########################
#
$FileOwner root
$FileGroup adm
$FileCreateMode 0640
#
# Include all config files in /etc/rsyslog.d/
#
$IncludeConfig /etc/rsyslog.d/*.conf
###################
#### templates ####
###################
$AllowedSender UDP, 192.168.145.254
$template F50,"insert into SystemEvents (ReceivedAt, DeviceReportedTime, FromHost, srcip, srcport, dstip, dstport, proto, action) values ('%timereported:::date-mysql%', '%HOSTNAME%', '%msg:F,20:11%', '%msg:F,20:12%', '%msg:F,20:14%', '%msg:F,20:15%', '%msg:F,20:9%', '%msg:F,20:17%')",sql
*.* >localhost,Syslog,syslogfeeder,feeder;F50
and this the data receive from the firewall :
id=firewall time="2008-07-31 15:09:26" fw="F50-EE592000800808" tz=+0000 startime="2008-07-31 15:09:26" pri=1 srcif="Ethernet0" srcifname="In" ipproto=udp proto=netbios-dgm src=192.168.2.150 srcport=138 srcportname=netbios-dgm dst=192.168.2.255 dstport=138 dstportname=netbios-dgm action=block msg="IP address spoofing (type=1)" class=protocol classification=0 alarmid=1 logtype="alarm"
I search a solution in the forum but i don't find an explicit one.
Thank you for your help.
Regards


