Tuesday, August 14, 2007

rsyslog changes for 2007-08-14

Do you remember? I promised to make no more major changes to rsyslog until around September. Among the things I did not intend to do was a plug-in interface. And, yes, I did not do that. But varmojfekoj, a frequent contributor, did it ;)

As varmojfekoj says himself, this is not a full-blown plugin implementation. But he has converted the MySQL output module into a loadable plugin. The current output module interface API has some restrictions, so it is not 100% clean - but by far clean enough to be used in practice.

The big advantage of having this plug-in is that package maintainers now can create two packages for rsyslog: one for the base system and another one for the mysql functionality. This removes a lot of problems. For example, when rsyslog was compiled with MySQL support, it would have required the MySQL client to be present. This would not be acceptable for a default syslogd (after all, each system would need to have MySQL client installed...) - clearly unacceptable. Now the base (default) system can be supplied without MySQL (which is no longer tied in). And those who desired database logging, can simply add the MySQL plug-in add-on package. That package will of course pull the MySQL client, but that's fine if you would actually like to use it (sounds only fair, doesn't it?).

OK, finally, here is my (small) work log:

- integrated patch from varmojfekoj to make the mysql module a loadable
many thanks for the patch, MUCH appreciated
- added some code to support the forward-compatibilty directive
$ModLoad MySQL - this is now internally translated to the right name
Needs to be revisited, but is clean enough for now.


Michael said...

Regarding the mysql shared module:
Makefile.am has a fixed path /lib/rsyslog for rsyslogmoddir.
I could imagine that this can cause problems on platforms which use /lib64 (like some distros do for amd64).

Maybe $(libdir)/rsyslog for rsyslogmoddir would be a better choice?

Rainer said...

Thanks for the useful comment. We'll look at it. All in all, there are some small nits, but these will be resolved at latest during the spring implementation of a fuller module de-init.

Rainer said...

lol... of course I meant fall, not spring ;)

simplifying rsyslog JSON generation

With RESTful APIs, like for example ElasticSearch, you need to generate JSON strings. Rsyslog will soon do this in a very easy to use way. ...