13 Jul
2010
13 Jul
'10
11:54 a.m.
On Tue, 2010-07-13 at 13:43 +0400, Khaleelah Peerbocus wrote:
Hi
How can I avoid line breaks in syslog-ng when it is configured using pipe
destination d_mssql {
pipe("/tmp/mssql.syslog-ng.pipe" flags(no-multi-line)
template("INSERT INTO logs(datetime,host,program,pid,message)VALUES('$R_DATE','$HOST','$PROGRAM','$PID','$MSGONLY');")
template-escape(yes));
};
log {
source(src);
filter(f_debug);
destination(d_mssql);
};
Then I have a script reading the pipe
if [ -e /tmp/mssql.syslog-ng.pipe ]; then
while [ -e /tmp/mssql.syslog-ng.pipe ]
do
isql -v MSTEST "sa" "password" < /tmp/mssql.syslog-ng.pipe
done
else
mkfifo /tmp/mssql.syslog-ng.pipe
fi
Problem is the sql query is getting broken down in 3 lines
Where does it break? Can you also post an example? -- Bazsi