[syslog-ng]syslog-ng truncating pipe template output

James Masson syslog-ng@lists.balabit.hu
Mon, 22 Nov 2004 16:56:08 +0100


Hi Nate


I've tried a variety of formatting in destination_firewalls with no
effect on this problem.
I've inserted extra spaces and newlines in various places. The resulting
output is still truncated and the extra formatting works only before
this point.
The current format I'm using in desination_firewalls is all on one line,
and the output is all on one line.
I've tried "template-escape(no)" - still the same problem

###########################################
Syslog-ng.conf
###########################################
# $Header:
/var/cvsroot/gentoo-x86/app-admin/syslog-ng/files/syslog-ng.conf.gentoo,
v 1.4 2004/07/18 02:25:02 dragonheart Exp $
#
# Syslog-ng default configuration file for Gentoo Linux
# contributed by Michael Sterrett

options {
        long_hostnames(off);
        sync(0);

        # The default action of syslog-ng 1.6.0 is to log a STATS line
        # to the file every 10 minutes.  That's pretty ugly after a
while.
        # Change it to every 12 hours so you get a nice daily update of
        # how many messages syslog-ng missed (0).
        stats(43200);
        log_msg_size(8192);
        log_fifo_size(8192);
};

source src { unix-stream("/dev/log"); internal(); pipe("/proc/kmsg"); };

destination messages { file("/var/log/messages"); };

# By default messages are logged to tty12...
destination console_all { file("/dev/tty12"); };
# ...if you intend to use /dev/console for programs like xconsole
# you can comment out the destination line above that references
/dev/tty12
# and uncomment the line below.
#destination console_all { file("/dev/console"); };

log { source(src); destination(messages); };
log { source(src); destination(console_all); };

## Log to mysql
## OUtput for unix_servers mysql database
destination unix_servers {
pipe("/tmp/mysql_unix_servers.pipe"
template("INSERT INTO logs (host, facility, priority, level, tag, date,

time, program, msg) VALUES ( '$HOST', '$FACILITY', '$PRIORITY',
'$LEVEL',
'$TAG',

'$YEAR-$MONTH-$DAY', '$HOUR:$MIN:$SEC', '$PROGRAM', '$MSG' );\n")
template-escape(yes));

};
##### Output for firewalls mysql database
destination firewalls { pipe("/tmp/mysql_firewalls.pipe" template("
INSERT INTO logs (host, facility, priority, level, tag, date, time,
program, msg) VALUES ( '$HOST', '$FACILITY', '$PRIORITY', '$LEVEL',
'$TAG', '$YEAR-$MONTH-$DAY', '$HOUR:$MIN:$SEC', '$PROGRAM', '$MSG');\n")
template-escape(yes));
};


##### Output for appliances mysql database
destination appliances {
pipe("/tmp/mysql_appliances.pipe"
template("INSERT INTO logs (host, facility, priority, level, tag, date,

time, program, msg) VALUES ( '$HOST', '$FACILITY', '$PRIORITY',
'$LEVEL',
'$TAG',

'$YEAR-$MONTH-$DAY', '$HOUR:$MIN:$SEC', '$PROGRAM', '$MSG' );\n")
template-escape(yes));

};
### Output for routers mysql database
destination routers {
pipe("/tmp/mysql_routers.pipe"
template("INSERT INTO logs (host, facility, priority, level, tag, date,

time, program, msg) VALUES ( '$HOST', '$FACILITY', '$PRIORITY',
'$LEVEL',
'$TAG',

'$YEAR-$MONTH-$DAY', '$HOUR:$MIN:$SEC', '$PROGRAM', '$MSG' );\n")
template-escape(yes));

};

### filter udp stream to desitnations based on facility
log { source(net); filter(f_routers); destination(routers); };
log { source(net); filter(f_firewalls); destination(firewalls); };
log { source(net); filter(f_appliances); destination(appliances); };
log { source(net); filter(f_unix_servers); destination(unix_servers); };

#### Define incoming udp logging stream
source net { udp(); };

### Define facilities filters
filter f_routers { facility(local3); };
filter f_firewalls { facility(local4); };
filter f_unix_servers { facility(local5); };
filter f_appliances { facility(local6); };
#################################################

Thanks

James Masson