[syslog-ng] MySQL syslog-ng regex
Hari Sekhon
hpsekhon at googlemail.com
Thu Mar 1 11:24:47 CET 2007
one more thought, did you try ${10} or something?
This works in shell so it's worth a try.
-h
Hari Sekhon
Fat Wallet wrote:
> 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!
>
> ------------------------------------------------------------------------
> Finding fabulous fares is fun.
> Let Yahoo! FareChase search your favorite travel sites
> <http://farechase.yahoo.com/promo-generic-14795097;_ylc=X3oDMTFtNW45amVpBF9TAzk3NDA3NTg5BF9zAzI3MTk0ODEEcG9zAzEEc2VjA21haWx0YWdsaW5lBHNsawNxMS0wNw-->
> to find flight and hotel bargains.
> ------------------------------------------------------------------------
>
> _______________________________________________
> syslog-ng maillist - syslog-ng at lists.balabit.hu
> https://lists.balabit.hu/mailman/listinfo/syslog-ng
> Frequently asked questions at http://www.campin.net/syslog-ng/faq.html
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.balabit.hu/pipermail/syslog-ng/attachments/20070301/634c0514/attachment.html
More information about the syslog-ng
mailing list