[rsyslog] Asterisk log into rsyslog mysql backend with double quotes
Marc Leurent
lftsy at leurent.eu
Wed Aug 12 19:05:13 CEST 2009
Good evening,
I have a simple problem and I would be very grateful if you could help me, I'm trying to put Asterisk logs into a MySQL database using the
powerful rsyslog!
It's working, except when Asterisk generates syslog message with double quotes!
So my Asterisk server is logging to syslog.local0 into rsyslog
and with the config below, I put the logs into a mysql database!
$template bobsql,"INSERT INTO log (server, date, heure, message) VALUES ('%HOSTNAME%', DATE(%timereported:::date-mysql%),
TIME(%timereported:::date-mysql%), '%msg%')",SQL
local0.* :ommysql:localhost,asterisk_db,asterisk,bob;bobsql
It adds any line except when the %msg% contains a double quote like this one:
NOTICE[25608] chan_sip.c: Registration from '"1001" <sip:1001 at leurent.eu>' failed for '88.191.80.8' - Wrong password
Could you explain me what I should change to be able to put double quote in the database.
Thanks!
--
-- --
Marc LEURENT
lftsy at leurent.eu
More information about the rsyslog
mailing list