<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#0050d0">
<font size="-1"><font face="Helvetica, Arial, sans-serif">"bar.baz" is
the proper way of doing this but was not handled properly in the
syslog-ng code. I filed a bug report on this and the fix has been
incorporated into 3.2 (<a class="moz-txt-link-freetext" href="https://bugzilla.balabit.com/show_bug.cgi?id=73">https://bugzilla.balabit.com/show_bug.cgi?id=73</a>
item number 2).<br>
So, you have 3 options<br>
1) you can download the patch on that bug and manually build the fix
into your code and build it yourself<br>
2) add an alias so it knows which schema that table is in<br>
3) wait for 3.2<br>
</font></font><br>
Sent: Tuesday, July 27, 2010 12:28:03 PM<br>
From: John Kristoff <a class="moz-txt-link-rfc2396E" href="mailto:jtk@cymru.com"><jtk@cymru.com></a><br>
To: <a class="moz-txt-link-abbreviated" href="mailto:syslog-ng@lists.balabit.hu">syslog-ng@lists.balabit.hu</a> <br>
Subject: [syslog-ng] sql() and pgsql
<blockquote cite="mid:20100727132803.3d2575ae@t61p" type="cite">
<pre wrap="">Hello,
First thanks to Bazsi and co. for years of great work on syslog-ng.
I've used it off and on for some time and have always found it to be
well implemented and supported. I've experimented a bit with rsyslog
since some distros have been making it their new default and found
syslog-ng to be easier to work with and more reliable for my tasks.
I'm been playing around with v3.0.8 and the sql() / pgsql output driver
to insert log data into a specific table on a specific schema. I
couldn't figure out how to specify the schema and maybe its just not
supoprted. For instance, if the following is defined:
database: foo
schema: bar
table: baz
but the PostgreSQL search path for the user doesn't include bar, then
syslog-ng will attempt to create a table in the default schema (usually
'public'). I tried setting the table name to "bar.baz", but that just
created a table named bar_baz in the default schema. I did a quick
check in the source code and didn't see where this was occurring, maybe
its a function of a third party library?
If schema support was available that would be nice. For posterity
sake and maybe a FAQ, the work around is to alter the search_path for
the user (e.g. ALTER ROLE user SET search_path = bar,public;).
On a related note, it might be nice to have an option to avoid creating
a table if it does not already exist. If nothing else, this helps limit
the permissions granted to the syslog-ng db user, which would be
appreciated. Likewise, it might also be nice to have an option that
can disable checking if the table exists (the "SELECT * FROM %s WHERE
0=1" query) to further lock down user permissions.
John
______________________________________________________________________________
Member info: <a class="moz-txt-link-freetext" href="https://lists.balabit.hu/mailman/listinfo/syslog-ng">https://lists.balabit.hu/mailman/listinfo/syslog-ng</a>
Documentation: <a class="moz-txt-link-freetext" href="http://www.balabit.com/support/documentation/?product=syslog-ng">http://www.balabit.com/support/documentation/?product=syslog-ng</a>
FAQ: <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>