[syslog-ng] MySQL syslog-ng regex

Fat Wallet fat8wallet at yahoo.com
Wed Feb 28 22:36:57 CET 2007


Hi,

I am having problem inserting logs into MySQL using match() that returns more than 10 arguements.


destination d_mysql  {
pipe("/tmp/mysql.pipe"
template("INSERT INTO mydatabase (content_name) VALUES ('$10');\n") template-escape(yes));
};

filter f_filter { match ("^.*?:   \"(.*)\",\"(.*)\",\"(.*)\",\"(.*)\",\"(.*)\",\"(.*)\",\"(.*)\",\"(.*)\",\"(.*)\",\"(.*)$"); };

log { source(s_stunnel); filter(f_filter); destination(d_mysql); };


incoming log message is as followed:
"test1","test2","test3","test4","test5","test6","test7","test8","test9","testN","testN1"

catting mysql.pipe:
$>cat /tmp/mysql.pipe

INSERT INTO mydatabase (content_name) VALUES ('test10');

So instead of 'testN', I am getting the 'test1' appends with 0 which is 'test10'

Thanks for the help!




 
____________________________________________________________________________________
Any questions? Get answers on any topic at www.Answers.yahoo.com.  Try it now.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.balabit.hu/pipermail/syslog-ng/attachments/20070228/c590eecf/attachment.htm


More information about the syslog-ng mailing list