<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
pre
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=FR link=blue vlink=blue>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>Add a « & »
at the end of the line with « mysql » to run the mysql client as a
background task.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>De :</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
syslog-ng-bounces@lists.balabit.hu [mailto:syslog-ng-bounces@lists.balabit.hu] <b><span
style='font-weight:bold'>De la part de</span></b> gatfi sami<br>
<b><span style='font-weight:bold'>Envoyé :</span></b> dimanche 5 avril
2009 02:31<br>
<b><span style='font-weight:bold'>À :</span></b> <st1:PersonName w:st="on">Syslog-ng
users' and developers' mailing list</st1:PersonName><br>
<b><span style='font-weight:bold'>Objet :</span></b> [syslog-ng] problem
in writing to database 2</span></font><o:p></o:p></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>i succefully added the folowing script to <br>
<br>
/etc/profile<br>
<br>
it recreates the pilpline but <br>
<br>
when i get access to the virtual machine by ssh it is blocked<br>
like this:<br>
Password: <br>
<br>
<b><span style='font-weight:bold'>Last login: Sun Apr 5 03:08:51 2009 from
linux-ux35.lan <br>
Have a lot of fun...<br>
<br>
</span></b>i have to tape ctrl + c to <br>
have<br>
linux-test1:~ # <br>
<br>
<br>
<br>
i have to tape ctrl +c to get access to it <br>
<br>
<br>
here is the script<br>
<br>
<o:p></o:p></span></font></p>
<div style='mso-element:para-border-div;border:inset 1.0pt;padding:5.0pt 5.0pt 5.0pt 5.0pt'><pre
style='border:none;padding:0cm'><font size=2 face="Courier New"><span
style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre
style='border:none;padding:0cm'><font size=2 face="Courier New"><span
style='font-size:10.0pt'>#!/bin/bash<br>
if [ -e /tmp/mysql.pipe ]; then<br>
while [ -e /tmp/mysql.pipe ]<br>
do<br>
mysql -u root --password= syslog< /tmp/mysql.pipe<br>
done<br>
else<br>
mkfifo /tmp/mysql.pipe<br>
fi<o:p></o:p></span></font></pre></div>
<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><br>
<br>
i think the problem is from <br>
<br>
mysql -u root --password= syslog< /tmp/mysql.pipe<br>
<br>
<br>
<o:p></o:p></span></font></p>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>2009/4/4 gatfi sami <<a href="mailto:pfegatfi.sami@gmail.com">pfegatfi.sami@gmail.com</a>><o:p></o:p></span></font></p>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>hi<br>
<br>
i am configuring a centralised syslog server and when i arrived to the writing
into the database there is some thing wrong <br>
<br>
because when i use a file as destination i see incoming logs when i restart
apache2 or mysql in the client<br>
<br>
"tail - f /"<br>
i use syslog -ng 2.0<br>
<br>
here is the client<br>
<b><span style='font-weight:bold'>source my_src{<br>
file("/var/log/apache2/error_log" follow_freq(1) );<br>
<br>
file("/var/lib/mysql/mysqld.log" follow_freq(1) );<br>
<br>
};<br>
<br>
<br>
destination loghost {<br>
tcp("192.168.1.69" port(514));<br>
};<br>
log {<br>
source(my_src);<br>
destination(loghost);<br>
};</span></b><br>
<br>
<br>
<br>
here is the server<br>
<br>
<b><span style='font-weight:bold'> source mysrc{ tcp(ip(0.0.0.0) port(514)
keep-alive(yes));<br>
#udp();<br>
};<br>
<br>
destination d_mysql {<br>
pipe("/tmp/mysql.pipe"<br>
template("INSERT INTO logs (host, facility, priority, level, tag,
date,<br>
time, program, msg) VALUES ( '$HOST', '$FACILITY', '$PRIORITY',
'$LEVEL',<br>
'$TAG',<br>
'$YEAR-$MONTH-$DAY', '$HOUR:$MIN:$SEC', '$PROGRAM', '$MSG' );\n")<br>
template-escape(yes));<br>
};<br>
log { source(mysrc); destination(d_mysql);<br>
};<br>
</span></b><br>
<br>
note that a databes names syslog is already created and contain a table logs;<br>
<br>
<br>
<br>
if itry the following command : syslog-ng -f /etc/syslog-ng/syslog-ng.conf<br>
<br>
Error binding socket; addr='AF_INET(0.0.0.0:514)', error='Address already in
use (98)'<br>
Error initializing source driver; source='mysrc'<br>
<br>
<br>
ps i used to use the server as relai and send by udp using the same port 514
but now everinthing is <br>
<br>
commented like this #<br>
<br>
need help<o:p></o:p></span></font></p>
</div>
</div>
<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><br>
i added the following script to the file <o:p></o:p></span></font></p>
</div>
</div>
</body>
</html>