<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
your destination is wrong.<br>
<br>
it should something more like this<br>
<br>
destination d_mysql { pipe("/var/log/mysql.pipe" template("INSERT INTO
logs (host, facility, priority, level, tag, datetime, program, msg)
VALUES ( '$HOST', '$FACILITY', '$PRIORITY', '$LEVEL', '$TAG',
'$YEAR-$MONTH-$DAY $HOUR:$MIN:$SEC', '$PROGRAM', '$MSG' );\n")
template-escape(yes)); };<br>
<br>
This will form a proper mysql statement.<br>
<br>
But to simplify for your example:<br>
<br>
destination d_mysql {<br>
pipe("/tmp/mysql.pipe"<br>
template("INSERT INTO mydatabase (content_name) VALUES <b>('$10')</b>;\n")
template-escape(yes));<br>
};<br>
<br>
Try reviewing your regex to capture only what you want and then try
again. You could for example try making the regex capture only the bit
you want so it is contained in $1 instead.<br>
<br>
But yes I see there is a problem getting the 10th argument, perhaps one
of the devs will have more info on how to get $10.<br>
<br>
-h<br>
<pre class="moz-signature" cols="72">Hari Sekhon
</pre>
<br>
<br>
Fat Wallet wrote:
<blockquote cite="mid561755.77225.qm@web62212.mail.re1.yahoo.com"
type="cite">
<style type="text/css"><!-- DIV {margin:0px;} --></style>
<div
style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
<div
style="font-family: times new roman,new york,times,serif; font-size: 12pt;">Hi,<br>
<br>
I am having problem inserting logs into MySQL using match() that
returns more than 10 arguements.<br>
<br>
<br>
destination d_mysql {<br>
pipe("/tmp/mysql.pipe"<br>
template("INSERT INTO mydatabase (content_name) VALUES ('$10');\n")
template-escape(yes));<br>
};<br>
<br>
filter f_filter { match ("^.*?:
\"(.*)\",\"(.*)\",\"(.*)\",\"(.*)\",\"(.*)\",\"(.*)\",\"(.*)\",\"(.*)\",\"(.*)\",\"(.*)$");
};<br>
<br>
log { source(s_stunnel); filter(f_filter); destination(d_mysql); };<br>
<br>
<br>
incoming log message is as followed:<br>
"test1","test2","test3","test4","test5","test6","test7","test8","test9","testN","testN1"<br>
<br>
catting mysql.pipe:<br>
$>cat /tmp/mysql.pipe<br>
<br>
INSERT INTO mydatabase (content_name) VALUES ('test10');<br>
<br>
So instead of 'testN', I am getting the 'test1' appends with 0 which is
'test10'<br>
<br>
Thanks for the help!<br>
</div>
</div>
<br>
<hr size="1">Finding fabulous fares is fun.<br>
<a
href="http://farechase.yahoo.com/promo-generic-14795097;_ylc=X3oDMTFtNW45amVpBF9TAzk3NDA3NTg5BF9zAzI3MTk0ODEEcG9zAzEEc2VjA21haWx0YWdsaW5lBHNsawNxMS0wNw--">Let
Yahoo! FareChase search your favorite travel sites</a> to find flight
and hotel bargains.
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
syslog-ng maillist - <a class="moz-txt-link-abbreviated" href="mailto:syslog-ng@lists.balabit.hu">syslog-ng@lists.balabit.hu</a>
<a class="moz-txt-link-freetext" href="https://lists.balabit.hu/mailman/listinfo/syslog-ng">https://lists.balabit.hu/mailman/listinfo/syslog-ng</a>
Frequently asked questions at <a class="moz-txt-link-freetext" href="http://www.campin.net/syslog-ng/faq.html">http://www.campin.net/syslog-ng/faq.html</a>
</pre>
</blockquote>
</body>
</html>