[syslog-ng]syslog-ng template does not work

Earls, Michael syslog-ng@lists.balabit.hu
Mon, 1 Nov 2004 16:21:29 -0500


The template() destinations are only supported by the 1.5.x and up.  I would
upgrade your version of syslog-ng.

Michael

PGP Info: KeyID 0x0DFD993C
Fingerprint F903 0325 5105 2CDB 4BF4 C88B 72F7 BA7A 28CC 598A 


-----Original Message-----
From: Sirinus [mailto:sirinus@excite.com]
Sent: Monday, November 01, 2004 2:39 PM
To: syslog-ng@lists.balabit.hu
Subject: [syslog-ng]syslog-ng template does not work




Hello, Everyone,

I just installed syslog-ng on my mandrake-9.2 with the rpm package:  

syslog-ng-1.4.17-3mdk.src.rpm

For generly log, it works fine. However, I would like to forward my logs to
MySql database. So I tried to follow the tutorials of Michael Earls  (
ohttp://vermeer.org/display_doc.php?doc_id=1). However, after I added  the
following line to my syslog-ng.conf, each time when I tried to restart
syslog-ng, it tells sth is wrong. The following is what I have done:

1. Add the following to my syslog-ng.conf so that I can log to mysql
database:

## Log syslog-ng to mysql database
##
destination d_mysql {
pipe("/tmp/mysql.pipe"
template("INSERT INTO logs (host, facility, priority, level, tag, date,
time, program, msg) VALUES ( '$HOST', '$FACILITY', '$PRIORITY', '$LEVEL',
'$TAG', '$YEAR-$MONTH-$DAY', '$HOUR:$MIN:$SEC', '$PROGRAM', '$MSG' );\n")
template-escape(yes));
};

log { source(net); destination(d_mysql);
};

2. stop syslog-ng

[root@localhost tmp]# service syslog-ng stop
Shutting down kernel logger:                                 [  OK  ]
Shutting down system logger:                                 [  OK  ]

3. restart syslog-ng

[root@localhost tmp]# service syslog-ng start
Starting system logger: parse error at 27
Parse error reading configuration file, exiting.
                                                             [FAILED]
starting kernel logger:                                      [  OK  ]

NOTE: line 27 is where "template ("INSERT INTO logs (host, facility,
priority, level, tag, " showing the first step.


I wonder to know what's wrong with this configuration? I tried to read the
source code. I cannot find any thing related to "template". Does syslog-ng
1.4.17 support "template"? How could I fix the problem?

THanks a lot

Yours


Ch Zhang

_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!
_______________________________________________
syslog-ng maillist  -  syslog-ng@lists.balabit.hu
https://lists.balabit.hu/mailman/listinfo/syslog-ng
Frequently asked questions at http://www.campin.net/syslog-ng/faq.html


This e-mail transmission contains information that is confidential and may be privileged.   It is intended only for the addressee(s) named above. If you receive this e-mail in error, please do not read, copy or disseminate it in any manner. If you are not the intended recipient, any disclosure, copying, distribution or use of the contents of this information is prohibited. Please reply to the message immediately by informing the sender that the message was misdirected. After replying, please erase it from your computer system. Your assistance in correcting this error is appreciated.