[syslog-ng] exclude empty pairs from json-parser()

Scheidler, Bal√°zs balazs.scheidler at balabit.com
Tue May 22 07:38:39 UTC 2018


Hmm, it was a feature to handle zero length values properly, and at the
same time I've added the unset() rewrite operation, which causes name-value
pairs to be omitted.

It might make sense to add a --skip-empty-values or similar option to
$(format-json), would that solve your problem? Can you elaborate your



On Tue, May 22, 2018 at 7:50 AM, Nik Ambrosch <nik at ambrosch.com> wrote:

> Hi - I'm trying to figure out how to instruct json-parser() to exclude
> empty (or nonexistent) json pairs from being passed to it's template.  This
> is possible with the csv parser using null("") but not json.
> It seems that if i specify all my json-parser() pairs using --pair
> example=\"${MYMACRO}\" the desired behavior is achieved, however using
> --scope nv-pairs instead will log the empty values.
> ____________________________________________________________
> __________________
> 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/20180522/107490aa/attachment-0001.html>

More information about the syslog-ng mailing list