[syslog-ng]syslog-ng mysql syntax error

Lopez Fernandez, Jose syslog-ng@lists.balabit.hu
Thu, 25 Nov 2004 12:28:31 +0100


This is a multi-part message in MIME format.

------=_NextPartTM-000-91469380-6aa0-4da6-85e2-d05b9ba59d68
Content-Type: multipart/alternative; 
    boundary="----_=_NextPart_001_01C4D2E1.E4851C24"


------_=_NextPart_001_01C4D2E1.E4851C24
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

Hi,

since some days i get errors in like this:
ERROR 1064 at line 4: You have an error in your SQL syntax.  Check the
manual that corresponds to your MySQL server version for the right
syntax to use near
'ws-61078', 'kern', 'crit', 'crit', '02', '2004-11-24', '10:55:

It seems, that the Quotes after the MSG-Tag are missing. so the
insert-command for MySql isn`t complete.
I can`t see any fault in my config.=20

This is my config (syslog-ng 1.6.4):

options {stats(28800); long_hostnames(on); sync(0); log_fifo_size(2000);
use_dns(on);  };
     2  #
     3  ## Log syslog-ng to mysql database
     4  ##
     5  destination d_mysql {
     6  pipe("/tmp/mysql.pipe"
     7  template("INSERT INTO logs (host, facility, priority, level,
tag, date,
     8  time, program, msg) VALUES ( '$HOST', '$FACILITY', '$PRIORITY',
'$LEVEL', '$TAG',
     9  '$YEAR-$MONTH-$DAY', '$HOUR:$MIN:$SEC', '$PROGRAM', '$MSG'
);\n") template-escape(yes));
    10  };
    11  source local { sun-streams("/dev/log") ; internal();};
    12  source net { udp(); };
    13  log { source(net); destination(d_mysql);};
    14  log { source(local); destination(d_mysql);};


I have read, that someone had this problem too in the mailingslist, but
i didn`t find any suggestion for a workaorund
or a solution. I`m now analysing this problem 2 days an didn`t find any
workaround / solution. Hope someone could
help me :-)

thanks,
Jose Lopez


Dieses Dokument ist vertraulich und ausschliesslich fuer den Adressaten bes=
timmt. Falls Sie diese E-Mail versehentlich bekommen haben, informieren Sie=
 uns bitte unverzueglich und loeschen Sie diese Nachricht von Ihrem Compute=
r. Jegliche Art von Reproduktion, Verbreitung, Vervielfaeltigung, Modifikat=
ion, Verteilung und/oder Publikation dieser E-Mail Nachricht ist untersagt.=
 Die in dieser E-Mail enthaltenen Angaben und Erklaerungen sind unverbindli=
ch. Haftungsansprueche des Empfaengers jeglicher Art werden ausgeschlossen.=
 Die GZS schliesst ausser fuer den Fall von Vorsatz oder grober Fahrlaessig=
keit die Haftung fuer jeglichen Verlust oder Schaeden durch virenbefallene =
Software oder E-Mails aus.
---------------------------------------------------------------------------=
--------------------------------
This message contains confidential information and is intended only for the=
 named individual. If you are not the named addressee, you should not disse=
minate, distribute or copy this e-mail. Please notify the sender immediatel=
y by e-mail if you have received this message in error and delete this e-me=
ssage from your system.
No reliance may be placed on this message without written confirmation of i=
ts contents from an authorized representative. GZS accepts no liability for=
 loss or damage caused by software viruses except in case of gross negligen=
ce or willful behaviour.


------_=_NextPart_001_01C4D2E1.E4851C24
Content-Type: text/html; charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version 6.0.6603.0">
<TITLE>syslog-ng mysql syntax error </TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT FACE=3D"Times New Roman">Hi,</FONT>
</P>

<P><FONT FACE=3D"Times New Roman">since some days i get errors in like this=
:</FONT>

<BR><FONT FACE=3D"Times New Roman">ERROR 1064 at line 4: You have an error =
in your SQL syntax.&nbsp; Check the manual that corresponds to your MySQL s=
erver version for the right syntax to use near</FONT></P>

<P><FONT FACE=3D"Times New Roman">'ws-61078', 'kern', 'crit', 'crit', '02',=
 '2004-11-24', '10:55:</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">It seems, that the Quotes after the MSG-Ta=
g are missing. so the insert-command for MySql isn`t complete.</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">I can`t see any fault in my config. </FON=
T>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">This is my config (syslog-ng 1.6.4):</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">options {stats(28800); long_hostnames(on);=
 sync(0); log_fifo_size(2000); use_dns(on);&nbsp; };</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp; 2&nbsp; #</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp; 3&nbsp; ## Log s=
yslog-ng to mysql database</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp; 4&nbsp; ##</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp; 5&nbsp; destinat=
ion d_mysql {</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp; 6&nbsp; pipe(&qu=
ot;/tmp/mysql.pipe&quot;</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp; 7&nbsp; template=
(&quot;INSERT INTO logs (host, facility, priority, level, tag, date,</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp; 8&nbsp; time, pr=
ogram, msg) VALUES ( '$HOST', '$FACILITY', '$PRIORITY', '$LEVEL', '$TAG',</=
FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp; 9&nbsp; '$YEAR-$=
MONTH-$DAY', '$HOUR:$MIN:$SEC', '$PROGRAM', '$MSG' );\n&quot;) template-esc=
ape(yes));</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp; 10&nbsp; };</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp; 11&nbsp; source local =
{ sun-streams(&quot;/dev/log&quot;) ; internal();};</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp; 12&nbsp; source net { =
udp(); };</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp; 13&nbsp; log { source(=
net); destination(d_mysql);};</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp; 14&nbsp; log { source(=
local); destination(d_mysql);};</FONT>
</P>
<BR>

<P><FONT SIZE=3D2 FACE=3D"Arial">I have read, that someone had this problem=
 too in the mailingslist, but i didn`t find any suggestion for a workaorund=
</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">or a solution. I`m now analysing this pro=
blem 2 days an didn`t find any workaround / solution. Hope someone could</F=
ONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">help me :-)</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">thanks,</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">Jose Lopez</FONT>
</P>

<FONT SIZE=3D3><BR>
<BR>
Dieses Dokument ist vertraulich und ausschliesslich fuer den Adressaten bes=
timmt. Falls Sie diese E-Mail versehentlich bekommen haben, informieren Sie=
 uns bitte unverzueglich und loeschen Sie diese Nachricht von Ihrem Compute=
r. Jegliche Art von Reproduktion, Verbreitung, Vervielfaeltigung, Modifikat=
ion, Verteilung und/oder Publikation dieser E-Mail Nachricht ist untersagt.=
 <BR>
Die in dieser E-Mail enthaltenen Angaben und Erklaerungen sind unverbindlic=
h. Haftungsansprueche des Empfaengers jeglicher Art werden ausgeschlossen. =
Die GZS schliesst ausser fuer den Fall von Vorsatz oder grober Fahrlaessigk=
eit die Haftung fuer jeglichen Verlust oder Schaeden durch virenbefallene S=
oftware oder E-Mails aus.<BR>
---------------------------------------------------------------------------=
--------------------------------<BR>
This message contains confidential information and is intended only for the=
 named individual. If you are not the named addressee, you should not disse=
minate, distribute or copy this e-mail. Please notify the sender immediatel=
y by e-mail if you have received this message in error and delete this e-me=
ssage from your system.<BR>
No reliance may be placed on this message without written confirmation of i=
ts contents from an authorized representative. GZS accepts no liability for=
 loss or damage caused by software viruses except in case of gross negligen=
ce or willful behaviour.<BR>
</FONT>
</BODY>
</HTML>
------_=_NextPart_001_01C4D2E1.E4851C24--

------=_NextPartTM-000-91469380-6aa0-4da6-85e2-d05b9ba59d68--