[syslog-ng] trailing spaces on udp messages (now with NULLs!)

Balazs Scheidler bazsi at balabit.hu
Tue Jan 23 15:54:24 CET 2007


On Tue, 2007-01-23 at 11:58 +1100, Johan Fischer wrote:
> Works for me too, Thanks :)
> 
> Some programs still have trailing spaces in their logs like openldap and the 
> kernel iptables message, but I guess we can't do much about it ... ( an option 
> in the source / dest to trim spaces maybe ? ).

In these cases the sender application adds the space, and it is a
legitimate part of the message. syslog-ng could trim this off, but only
with an explicit option, I would not want to do this by default.

> 
> There is also one last part in the syslog-ng internal messages which has a 
> trailing space:
> 
> Jan 23 11:45:04 s_internal at mira syslog-ng[6559]: SIGTERM received, terminating;

this is the same thing above, eventlog always puts a ' ' to the end of
the message. I'd call this a bug...

...and this patch should fix it:

--- orig/src/evtfmt.c
+++ mod/src/evtfmt.c
@@ -57,7 +57,9 @@ evtrec_format_plain(EVTREC *e)
     return NULL;
   
   evt_str_append_escape_bs(es, e->ev_desc, strlen(e->ev_desc), ';');
-  evt_str_append(es, "; ");
+  evt_str_append(es, ";");
+  if (e->ev_pairs)
+    evt_str_append(es, " ");
   for (et = e->ev_pairs; et; et = et->et_next)
     {
       evt_str_append(es, et->et_tag);





-- 
Bazsi



More information about the syslog-ng mailing list