[syslog-ng] SQL destination - multiple destinations (tables) within one database ?

Tomáš Novosad tomas.novosad at linuxbox.cz
Thu Apr 3 09:13:30 CEST 2014


Hello,

i'd like to ask, if it si possible, somehow, to share one database connection
across mutliple SQL destinations?

Consider this setup (shortened):

destination table_a { sql( type(psql) host("localhost") username("my_login") password("secret") database("my_db") table("table_a") columns(...) values (...) ); };
destination table_b { sql( type(psql) host("localhost") username("my_login") password("secret") database("my_db") table("table_b") columns(...) values (...) ); };
destination table_c { sql( type(psql) host("localhost") username("my_login") password("secret") database("my_db") table("table_c") columns(...) values (...) ); };

when i'm using this setup, syslog open 3 separate connections to
database, 1 connection for each destination.

Is it possible to configure syslog-ng to use only 1 connection, as
database and login are the same for all 3 destinations ?

If there would be, let's say 50 different tables in single DB, there
would be 50 separate connections, which is a waste of resources, as Postgres
assign memory for each connection.

Also the config in syslog would be much simpler and easier to maintain,
if the connection would be described in some section, and destination
would define table name and point to some previously defined DB
connection.

Thanks for helping
-- 
Tomáš Novosad
LinuxBox.cz, s.r.o.
28. října 168, 709 00 Ostrava

tel.:   +420 591 166 221
mobil:  +420 737 238 655
email:  tomas.novosad at linuxbox.cz
jabber: novosad at linuxbox.cz
www.linuxbox.cz

mobil servis: +420 737 238 656
email servis: servis at linuxbox.cz



More information about the syslog-ng mailing list