[syslog-ng]syslog-ng messages sent to outside prog

Balazs Scheidler bazsi@balabit.hu
Tue, 6 Nov 2001 10:56:08 +0100


On Mon, Nov 05, 2001 at 11:50:15PM -0800, Nate Campi wrote:
> On Mon, Nov 05, 2001 at 03:03:15PM -0800, Nate Campi wrote:
> > 
> > I just setup sqlsyslogd to output to a mysql database from a program()
> > destination, and it prepends the <29> to the messages sent there as
> > well. 
> 
> I've been inputting logs into the database all day now, and I see that
> many different priorities are reported. The problem is that some
> prioritites are single digit (i.e. <6>) while others are double digit
> (i.e. <29>), messing up my C prog which parses the syslog messages. It
> counts on the timestamp portion being a certain number of characters.
> 
> I found this in afprogram.c:
> 
>   if (self->dest)
>                   A_WRITE_STRING(&self->dest->buffer->super,
>                                  c_format("<%i>%S %S %S\n",
>                                           msg->pri,
>                                           msg->date,
>                                           msg->host,
>                                           msg->msg));
> 
> I tried to remove the priority part:
> 
>   if (self->dest)
>                   A_WRITE_STRING(&self->dest->buffer->super,
>                                  c_format("%S %S %S\n",
>                                           msg->date,
>                                           msg->host,
>                                           msg->msg));
> 
> but it won't compile:
> 
> -DHAVE_CONFIG_H -I. -I/usr/src/syslog-ng-1.4.14/src -I.     -O2 -Wall
> -I/usr/src/libol-0.2.23/src -D_GNU_SOURCE -c afstreams.c
> /usr/src/libol-0.2.23/utils/make_class <afprogram.c >afprogram.c.xT
> /bin/sh: /usr/src/libol-0.2.23/utils/make_class: No such file or
> directory
> make[3]: *** [afprogram.c.x] Error 127
> make[3]: Leaving directory `/usr/src/syslog-ng-1.4.14/src'
> make[2]: *** [all-recursive] Error 1
> make[2]: Leaving directory `/usr/src/syslog-ng-1.4.14/src'
> make[1]: *** [all-recursive-am] Error 2
> make[1]: Leaving directory `/usr/src/syslog-ng-1.4.14/src'
> make: *** [all-recursive] Error 1

the problem is that you don't have scsh installed necessary to produce .x
files from .c and .h files. Since you didn't modify class definitions this
step is not required, so you can satisfy the dependency by touching
afprogram.c.x.

Another solution is to use the template() option in the 1.5.x series.

-- 
Bazsi
PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1