diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2004-11-23 08:51:24 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2004-11-23 08:51:24 +0000 |
commit | fc45231d62fdb3b75d2466d8b3b8135e17252abe (patch) | |
tree | d7fb00b39fd676f8bd3c20d86b18bb09453d6d0e /test.conf | |
parent | b6a8efa6014a062dedd205848bc891693562c282 (diff) | |
download | rsyslog-fc45231d62fdb3b75d2466d8b3b8135e17252abe.tar.gz rsyslog-fc45231d62fdb3b75d2466d8b3b8135e17252abe.tar.xz rsyslog-fc45231d62fdb3b75d2466d8b3b8135e17252abe.zip |
now includes sql option in template to escape quote chracters
Diffstat (limited to 'test.conf')
-rw-r--r-- | test.conf | 26 |
1 files changed, 17 insertions, 9 deletions
@@ -3,20 +3,27 @@ # as possible. We use "$" to start lines that contain new dirctives. # Set syslogd options -$template Name,"Text %var% Text",<max-length> +#$template Name,"Text %var% Text",<options> +# Template options are case-insensitive. Currently defined are: +# sql - format the string suitable for a SQL statement. This will replace single +# quotes ("'") by two single quotes ("''") inside each field. This option MUST +# be specified when a template is used for writing to a database, otherwise SQL +# injection might occur. The "sql" option is only used for database-bound +# templates. It is ignored for all others. + # To escape: # % = \% # \ = \\ # --> '\' is used to escape (as in C) #$template TraditionalFormat,"%UxTradMsg%\n",1024 -$template MySQLInsert,"insert iut, msg values (1, '%msg') into systemevents" -$template TraditionalFormat,"%timegenerated% %hostname% %syslogtag%%msg%\n" -$template precise,"%syslogpriority%,%syslogfacility%,%timegenerated%,%hostname%,%syslogtag%,%msg%\n",1024 -$template RFC3164fmt,"<%PRI%> %timegenerated% %hostname% %syslogtag%%msg%" -#$template RFC3164fmt,"%syslogpriority%,%syslogfacility% %timegenerated% %hostname% %syslogtag%%msg%",1024 -#$template precise,"%syslogpriority%,%syslogfacility%,%timegenerated::fulltime%,%hostname%,%syslogtag%,%msg%\n",1024 +#$template MySQLInsert,"insert iut, msg values (1, '%msg') into systemevents",SQL,MAXSIZE=1024 +$template TraditionalFormat,"%timegenerated% %HOSTNAME% %syslogtag%%msg%\n" +$template precise,"%syslogpriority%,%syslogfacility%,%timegenerated%,%HOSTNAME%,%syslogtag%,%msg%\n",1024 +$template RFC3164fmt,"<%PRI%>%TIMESTAMP% %HOSTNAME% %syslogtag%%msg%" +#$template precise,"%syslogpriority%,%syslogfacility%,%timegenerated::fulltime%,%HOSTNAME%,%syslogtag%,%msg%\n",1024 $template usermsg," %syslogtag%%msg%\n\r" -$template wallmsg,"\r\n\7Message from syslogd@%hostname% at %timegenerated% ...\r\n %syslogtag%%msg%\n\r" +$template wallmsg,"\r\n\7Message from syslogd@%HOSTNAME% at %timegenerated% ...\r\n %syslogtag%%msg%\n\r" +$template MySQLInsert,"insert iut, msg values (1, '%msg%') into systemevents", SQL # Selector lines are now modified # The "action" (e.g. file logging) can be followed @@ -24,7 +31,8 @@ $template wallmsg,"\r\n\7Message from syslogd@%hostname% at %timegenerated% ...\ # This is an example: #authpriv.* /var/log/secure,precise #*.* rger;usermsg -*.* *;wallmsg +#*.* *;wallmsg +*.* *;MySQLInsert *.* /home/rger/proj/rsyslog/logfile;precise #*.* /home/rger/proj/rsyslog/logfile;UserMsg *.* /home/rger/proj/rsyslog/tradfile;TraditionalFormat |