[rsyslog] Asterisk log into rsyslog mysql backend with double quotes
Rainer Gerhards
rgerhards at hq.adiscon.com
Wed Aug 12 21:49:16 CEST 2009
Not sure if i can look at this the next days (i have limited email only connnectivity...), but this looks somewhat strange. Please try to get a error message, maybe via running in debug mode.
----- Ursprüngliche Nachricht -----
Von: "Marc Leurent" <lftsy at leurent.eu>
An: "rsyslog at lists.adiscon.com" <rsyslog at lists.adiscon.com>
Gesendet: 12.08.09 19:12
Betreff: [rsyslog] Asterisk log into rsyslog mysql backend with double quotes
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
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com
More information about the rsyslog
mailing list