[syslog-ng] format-json reverse order?

Scheidler, Balázs balazs.scheidler at balabit.com
Sat Oct 31 16:25:21 CET 2015


We need to order the keys to generate json from our flat name value
structure.

There are a lot of things that make format-json slow, and could be sped up
easily, at least in my opinion.

Sorting doesn't help either, but unfortunately that part is needed.
On Oct 31, 2015 3:52 PM, "Evan Rempel" <erempel at uvic.ca> wrote:

> I am surprised that it orders them at all. The json object is key name specific, with ordering of list elements the only place where order could be important.
>
> I would think that sorting the keys is just a waste of time. The json format output is currently performance limited to around 15,000 events per second on the latest generation of CPU.
>
> I would be in favor of doing ANYTHING that could speed that up. Perhaps the ability to sort, and the ascending/descending order should be options to the json output template.
>
>
>
> Evan
>
> "Scheidler, Balázs" <balazs.scheidler at balabit.com> wrote:
>
>
> Hi,
>
> I've encountered a case where format-json orders keys not alphabetically,
> but rather in the other direction. Can you remember any reason for that?
>
> This is the only patch needed to fix the order, but I've figured there may
> have been some reason behind the ordering.
>
>  static gint
>  vp_walk_cmp(const gchar *s1, const gchar *s2)
>  {
> -  return strcmp(s2, s1);
> +  return strcmp(s1, s2);
>  }
>
>
> Thanks in advance,
>
> --
> Bazsi
>
>
> ______________________________________________________________________________
> 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/20151031/115c24bf/attachment.htm 


More information about the syslog-ng mailing list