On Mon, 2010-06-07 at 11:33 +0200, Dragan Zubac wrote:
Hello
It was my error,since I had a bug in regexp in a stored procedure in PostgreSQL,so the procedure was not processing particular message from syslog. By the way,is it possible for syslog-ng to call stored procedure directly,instead of logging into file and then another script picking up that data and storing them into database ? Basically,is it possible for a syslog-ng to do the following:
1. Got message,filter satisfied,it will call destination 'sql' for example. 2. destination 'sql' will connect to database,and do the following :
select * from syslog_procedure('$MSG');
instead of the classic way of insert:
insert into syslog_table (message) values ('$MSG');
not yet, but it's in my plans, something along the way: sql(.... values(string("$MSG"), expr("<sql expression>"))); e.g. you could enclose the value expression with a type specifier that'd tell syslog-ng how to interpret the expanded value. string: same as now, default expr: SQL expression, without enclosing the expanded string in quotes default: use the default value of the column -- Bazsi