[syslog-ng] tfjson: JSON-generating template function

Balazs Scheidler bazsi at balabit.hu
Sat Feb 5 14:31:07 CET 2011


On Fri, 2011-01-28 at 17:32 -0800, Matthew Hall wrote:
> On Fri, Jan 21, 2011 at 05:27:47PM +0100, Gergely Nagy wrote:
> > Based on the work of Balint Kovacs <blint at balabit.hu>, a $(format_json)
> > template function was implemented: with this function, one can hammer
> > log messages into JSON format.
> 
> > At the moment, only strings are supported, and there is no way to
> > structure the JSON properly yet. We'll figure out a way to do that too,
> > eventually. There's a few more things in the pipeline for tfjson, so
> > treat this version as a beta.
> > 
> > The code is available on the integration/tfjson/base branch of my
> > repository at git://git.madhouse-project.org/syslog-ng/syslog-ng-3.3.git
> > 
> > Browsable online at:
> > http://git.madhouse-project.org/syslog-ng/syslog-ng-3.3/tree/modules/tfjson/tfjson.c?h=integration/tfjson/base
> 
> > The bulk of the work was done by Balint, I just happened to accidentally
> > refactor it a tiny bit while reviewing his code.
> 
> Hello Gergely and Balint,
> 
> If I wanted to use this in a copy of syslog-ng 3.2, to bypass my current 
> extremely slow Perl code for parsing messages coming in from syslog-ng, 
> and replace it with the very fast JSON::XS, what would I need to do to 
> make a backport? Is that even possible, or would it be too much of a 
> mess? Since I am running in production I'd like to stick with a more 
> stable version of syslog-ng.

It should probably work simply by copying the files over. That part
hasn't changed much in 3.3. (I guess the original code by Balint has
worked within 3.2).

-- 
Bazsi




More information about the syslog-ng mailing list