Hi,
Both ways answer my needs.
I prefer to let a commiter/contributor choose the beter solution for the future of Syslog-ng.

By the way, I shall ask a feature un the bug tracking, or you already have one ?

Regards, Nicolas.

Le 11 août 2014 09:01, "Gergely Nagy" <algernon@balabit.hu> a écrit :
Balazs Scheidler <bazsi77@gmail.com> writes:

> I would prefer the creation of $(format-gelf) which would solve both the
> NUL issue and makes it easier for someone else to create GELF output.

FWIW, since there is no GELF C library out there, I started hacking on
one (which would also support chunking, and would provide an API we can
plug into LogWriter, so we won't have to make it a
LogThreadedDestDriver). It will take a while to finish it, because I'm
playing with getting the API right.

> Or alternatively, add an option to $(format-json) to add a suffix (and
> perhaps a prefix) in front of and after the resulting string. That would be
> useful for other purposes as well, and then $(format-gelf) could be
> implemented by my latest patches that enable the definition of template
> functions within the configuration file.
>
> E.g.
>
> template-function "format-gelf" "$(format-json --suffix "\x0" <format-json
> arguments to produce gelf>)"
>
> destination d_graylog {
>     network("1.2.3.4" transport(tcp) template("$(format-gelf)"); };
> };

How about $(char 0) as a template function? That can be reused outside
of format-json.

--
|8]
______________________________________________________________________________
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