[syslog-ng] Newbie
ajc80 at o2.co.uk
ajc80 at o2.co.uk
Sun Jan 29 16:30:27 CET 2006
Hello,
I'm a newbie to syslog-ng, I have followed the instructions and used and
altered the necessary examples to suit my directory structures, so my syslog
messages are dumped in to mysql database.
I'm using:
syslog-ng-1.6.8
libol-0.3.16
mysql 3.23.58
When starting syslog-ng I get the following messages:
# /etc/init.d/syslog-ng start
Starting MySQL pipe...
Starting syslog-ng...
Warning: No source refers to internal messages, they'll go to /dev/null
unresolved reference: inputs
Error initializing configuration, exiting.
The "No source refers to internal messages...." message I understand.
The "unresolved reference: inputs" I don't and can't seem to find anything
in the archives.
I've included the syslog-ng.conf file and the mysql.pipe file below.
Any help would be appreciated.
Thanks,
Adrian.
************ /etc/init.d/mysql.pipe ***********
#!/bin/sh
#
# Script to create a named pipe so syslog-ng messages
# can be sent to a MySQL database
#
if [ -p /var/run/mysql.pipe ]; then
mysql -u xxxxxxx --password=xxxxxxx logs < /var/run/mysql.pipe &
else
mkfifo /var/run/mysql.pipe
mysql -u xxxxxx --password=xxxxxx logs < /var/run/mysql.pipe &
fi
************ /etc/syslog-ng/syslog-ng.conf ***********
#####################################################################
# syslog-ng central log host configuration file
#
# installed: 29/01/2006 13:18
#
#####################################################################
# General options
options { check_hostname(yes);
keep_hostname(yes);
chain_hostnames(no); };
# Other important general options
# use_fqdn(yes);
# sync(0);
# keep_hostname(yes);
# chain_hostnames(no);
# create_dirs(yes);
#####################################################################
# Define syslog input stream
# This is specific to Solaris 9
# source inputs { internal();
# sun-streams("/dev/log" door("/var/run/syslog_door"));
# tcp(max_connections(1000)); };
# For newer versions of Linux (Debian GNU/Linux woody,
# and RedHat Linux post 7.0)
#
source stdlog { unix-dgram("/dev/log"); };
#####################################################################
# Define filters
# Level Filters
filter f_emerg { level (emerg); };
filter f_alert { level (alert .. emerg); };
filter f_crit { level (crit .. emerg); };
filter f_err { level (err .. emerg); };
filter f_warning { level (warning .. emerg); };
filter f_notice { level (notice .. emerg); };
# Facility Filters
filter f_kern { facility (kern); };
filter f_user { facility (user); };
filter f_mail { facility (mail); };
filter f_daemon { facility (daemon); };
filter f_auth { facility (auth); };
filter f_syslog { facility (syslog); };
filter f_lpr { facility (lpr); };
filter f_news { facility (news); };
filter f_uucp { facility (uucp); };
filter f_cron { facility (cron); };
filter f_local0 { facility (local0); };
filter f_local1 { facility (local1); };
filter f_local2 { facility (local2); };
filter f_local3 { facility (local3); };
filter f_local4 { facility (local4); };
filter f_local5 { facility (local5); };
filter f_local6 { facility (local6); };
filter f_local7 { facility (local7); };
# syslog-ng stats filter
filter f_n_stats { not match("STATS: dropped 0"); };
# syslog-ng "connect from filter
filter f_n_connected { not match("AF_INET client connected from"); };
#####################################################################
# Define where the logs can be stored
# Log log files
destination logpile {
file("/var/log/syslog-ng/$HOST/$YEAR/$MONTH/$FACILITY.$YEAR$MONTH$DAY"
owner(root) group(root) perm(0600)
create_dirs(yes) dir_perm(0700)); };
# Console log
destination console { file("/dev/sysmsg"); };
# Linux Console
# destination console { file("/dev/console"); };
# MySQL Database
destination d_mysql { pipe("/var/run/mysql.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));
};
#####################################################################
# Define logging
# Local log
log { source(inputs);
filter(f_n_stats);
filter(f_notice);
filter(f_n_connected);
destination(logpile); };
# Console
log { source(inputs);
filter(f_n_stats);
filter(f_err);
filter(f_n_connected);
destination(console); };
# MySQL Database
log { source(inputs);
filter(f_n_stats);
filter(f_notice);
filter(f_n_connected);
destination(d_mysql); };
________________________________________
For a wide range of mobile phones,free upgrades,accessories and tariffs plus
special deals when you buy online,visit www.o2.co.uk/shop <http://www.o2.co.uk/shop>
More information about the syslog-ng
mailing list