[syslog-ng] syslog-ng3 host_override() issue and proposed fix.

Nat Baldwin nbaldwin at rescomp.berkeley.edu
Sat Oct 2 01:27:31 CEST 2010


Hi there,

While trying to do something fairly specific with syslog-ng3, I ran into 
an error with an easy fix. I'm running syslog-ng3 3.1.1_1 on FreeBSD, 
installed from ports with SSL enabled and everything else default.

What I was trying to do was to use the host_override() function on a 
unix-dgram() source.  Time and again it was acting like the 
program_override() function instead; altering the program entry and not 
the host entry in the log.  When I went and looked at the source code, I 
noticed this in logsource.c:

145   if (self->options->program_override)
146     {
147       if (self->options->program_override_len < 0)
148         self->options->program_override_len = 
			strlen(self->options->program_override);
149       log_msg_set_value(msg, LM_V_PROGRAM, 
		  self->options->program_override,     
self->options->program_override_len);
150     }
151   if (self->options->host_override)
152     {
153       if (self->options->host_override_len < 0)
154         self->options->host_override_len = 
			strlen(self->options->host_override);
155       log_msg_set_value(msg, LM_V_PROGRAM, 
		  self->options->host_override, self->    
options->host_override_len);
156     }

Taking a not-so-wild guess, I changed line 155 to read:
log_msg_set_value(msg, LM_V_HOST,self->options->host_override, self->  
options->host_override_len);

(changing LM_V_PROGRAM to LM_V_HOST)

and that fixed my problem. Is this something that can be fixed, or 
should I be bringing this issue to someone in particular's attention? 

thanks,

-- 
Nat Baldwin
Unix Systems Administrator
Network Infrastructure, RSSP-IT
UC Berkeley



----- End forwarded message -----

-- 
Nat Baldwin
Unix Systems Administrator
Network Infrastructure, RSSP-IT
UC Berkeley
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.balabit.hu/pipermail/syslog-ng/attachments/20101001/b84dd2b9/attachment.pgp 


More information about the syslog-ng mailing list