[syslog-ng] R: syslog-ng fails logging to existing sqlite database

Andrea Laini andrea.laini at claypaky.it
Wed Oct 19 06:30:23 UTC 2016


Thanks for your answer.


libdbi 0.9.0 compilation error is following: libdbi-drivers-0.8.3-1/drivers/mysql/dbd_mysql.c:232:5: error: conflicting types for 'dbd_goto_row' .

Looking at its bitbake recipe on the OpenEmbedded online git you can find previous error is stated as a comment in the recipe itself (you can find it at this link http://cgit.openembedded.org/meta-openembedded/tree/meta-oe/recipes-support/libdbi/libdbi-drivers_0.8.3-1.bb).



After some other tests it seems that modifying sql statement ‘SELECT * FROM tableName WHERE 0=1’ into ‘SELECT * FROM tableName’ allow use of the log database: Syslog-ng doesn’t write anything into the db if it’s empty when logger started, but it works fine if I write a dummy record into the db so it’s not empty. But this is not the right way it should works, it’s a bad trick to bypass this issue.



Analyzing more in depth function calls tree, it seems that dbi structure for sql statement result doesn't contain any information about fields (columns) after quering "SELECT * FROM tableName WHERE 1=0".

Tried to mail this question to libdbi developers but no significant answer.



I’m gonna check for patch or other solution could fix this issue on the Balabit GitHub.



Many thanks


Please be informed that our offices will be closed for National Holidays from Monday 31/10/16 to Tuesday 01/11/16 included. We will be back on Wednesday 02/11/16.

Vi ricordiamo che saremo chiusi per festività i giorni lunedì 31/10/16 e martedì 01/11/16. Saremo nuovamente operativi da mercoledì 02/11/16.


Andrea Laini

Email: andrea.laini at claypaky.it<mailto:andrea.laini at claypaky.it>
_________________________________
Clay Paky S.p.A.
Via Pastrengo, 3/b - 24068 Seriate (BG) - ITALY
Phone: +39 - 035.654.311 - Fax: +39 - 035.30.18.76
Web: www.claypaky.it<http://www.claypaky.it/>
_________________________________
Read our Disclaimer @  www.claypaky.it/disclaimer<http://www.claypaky.it/disclaimer/index.html>


Da: syslog-ng [mailto:syslog-ng-bounces at lists.balabit.hu] Per conto di Scheidler, Balázs
Inviato: martedì 18 ottobre 2016 22:12
A: Syslog-ng users' and developers' mailing list <syslog-ng at lists.balabit.hu>
Oggetto: Re: [syslog-ng] syslog-ng fails logging to existing sqlite database


I vaguely remember having to apply a patch to libdbi drivers to make that column detection trick work with SQLite.

I also remember submitting it upstream but i don't know which version it was.

Hmm can you show the compilation problem with 0.9.0?

Also, balabit has a somewhat stale fork of libdbi and drivers on GitHub, those should definitely have that patch.

On Oct 13, 2016 2:48 PM, "Andrea Laini" <andrea.laini at claypaky.it<mailto:andrea.laini at claypaky.it>> wrote:
Hello everybody,

I would like to ask you a question about libdbi (version 0.8.4.1 with libdbi-drivers 0.8.3).
I’m using syslog-ng 3.5.4.1 on my Yocto Poky 1.7 Linux distro. I need to log my data into a sqlite3 database and everything works fine, but the database has not be written: no log data stored.
According to debug infos, it seems that syslog-ng recognizes that the database exists, connects to it, found (with the sql statement “SELECT * FROM tableName WHERE 0=1) that the table named “tableName” exists but it gets an error when verifying columns’ names; so it tries to add a column with that name to the table, but the operation fails since this column already exists.
I’ve googled and search on the web, but I’ve found nothing interesting. Trying syslog-ng 3.6.4 doesn’t change anything, while using libdbi 0.9.0 returns an error when compiling due to mismatch between function signature in the source and header file.

Have you any suggestions?

Thanks in advance,
Regards

Andrea



Please be informed that our offices will be closed for National Holidays from Monday 31/10/16 to Tuesday 01/11/16 included. We will be back on Wednesday 02/11/16.

Vi ricordiamo che saremo chiusi per festività i giorni lunedì 31/10/16 e martedì 01/11/16. Saremo nuovamente operativi da mercoledì 02/11/16.


Andrea Laini

Email: andrea.laini at claypaky.it<mailto:andrea.laini at claypaky.it>
_________________________________
Clay Paky S.p.A.
Via Pastrengo, 3/b - 24068 Seriate (BG) - ITALY
Phone: +39 - 035.654.311 - Fax: +39 - 035.30.18.76
Web: www.claypaky.it<http://www.claypaky.it/>
_________________________________
Read our Disclaimer @  www.claypaky.it/disclaimer<http://www.claypaky.it/disclaimer/index.html>


______________________________________________________________________________
Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng
FAQ: http://www.balabit.com/wiki/syslog-ng-faq

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.balabit.hu/pipermail/syslog-ng/attachments/20161019/9d258a49/attachment-0001.html>


More information about the syslog-ng mailing list