[syslog-ng]config file

Smith, James syslog-ng@lists.balabit.hu
Thu, 31 Mar 2005 14:44:07 -0500


This is my client side config file:

#
# Syslog-ng configuration file. Originally written by anonymous (I can't
find
# his name) Revised, and rewrited by me (SZALAY Attila <sasa@debian.org>)
# revised again by Nate Campi <nate at campin dot net>

###############################################################
# First, set some global options.

options { 
#	use_fqdn(yes); 
#	use_dns(yes); 
#	dns_cache(yes); 
	create_dirs (yes);
	keep_hostname(yes); 
	long_hostnames(on); 
	sync(1); 
	log_fifo_size(1024); 
	use_dns (yes);
};

###############################################################
#
# This is the default behavior of sysklogd package
# Logs may come from unix stream, but not from another machine.
#
#source src { unix-stream("/dev/log"); internal(); };


source src { 
#	don't read from /proc/kmsg and run klogd also (Linux)
#	pipe("/proc/kmsg"); 
#	file("/proc/kmsg") log_prefix("kernel: "); 
	sun-streams("/dev/log" door("/etc/.syslog_door")); 
#	unix-stream("/dev/log"); 
#	unix-stream("/chroot/named/dev/log"); 
	internal(); 
#	udp();
#	udp(ip("10.0.5.8") port(514)); 
#	tcp(port(5140) keep-alive(yes)); 
#	tcp(ip("10.9.9.3") port(5140) keep-alive(yes)); 
};

###############################################################
# After that set destinations.

# First some standard logfile
#
destination authlog { file("/var/log/auth.log"); };
destination bootlog { file("/var/log/boot.log"); };
destination cron { file("/var/log/cron.log"); };
destination daemon { file("/var/log/daemon.log"); };
destination debug { file("/var/log/debug"); };
destination explan { file("/var/log/explanations"); };
destination kern { file("/var/log/kern.log"); };
destination lpr { file("/var/log/lpr.log"); };
destination messages { file("/var/adm/messages"); };
destination routers { file("/var/log/routers.log"); };
destination secure { file("/var/log/secure"); };
destination spooler { file("/var/log/spooler"); };
destination syslog { file("/var/log/syslog"); };
destination user { file("/var/log/user.log"); };
destination uucp { file("/var/log/uucp.log"); };

# This files are the log come from the mail subsystem.
#
destination mail { file("/var/log/mail.log"); };
destination maillog { file("/var/log/maillog"); };
destination mailinfo { file("/var/log/mail.info"); };
destination mailwarn { file("/var/log/mail.warn"); };
destination mailerr { file("/var/log/mail.err"); };

# Logging for INN news system
#
#destination newscrit { file("/var/log/HOSTS/news.crit"); };
#destination newserr { file("/var/log/HOSTS/news.err"); };
#destination newsnotice { file("/var/log/HOSTS/news.notice"); };

# The root's console.
#
destination console { usertty("root"); };

# Virtual console.
#
destination console_all { file("/dev/tty8"); };

# The named pipe /dev/xconsole is for the nsole' utility.  To use it,
# you must invoke nsole' with the -file' option:
#
#    $ xconsole -file /dev/xconsole [...]
#
#destination xconsole { pipe("/dev/xconsole"); };

#
# scripts that accept syslog messages and mail them out
#
#destination mail-alert { program("/usr/local/bin/syslog-mail"); };
#destination mail-alert-perl { program("/usr/local/bin/syslog-mail-perl");
};

#
# hack to get swatch to read from stdin
#
destination swatch { program("/usr/bin/swatch --read-pipe=\"cat
/dev/fd/0\""); };

#
# destination database
#
#destination sqlsyslogd { 
#	program("/usr/local/sbin/sqlsyslogd -u sqlsyslogd -t logs sqlsyslogd
-p"); 
#};

##########################################

# Here's the filter options. With this rules, we can set which 
# message go where.

filter f_attack_alert { 
	match("attackalert"); 
};

filter f_ssh_login_attempt { 
	program("sshd.*") 
	and match("(Failed|Accepted)") 
	and not match("Accepted (hostbased|publickey) for (root|zoneaxfr)
from (10.4.3.1)"); 
};

#filter f_authpriv { facility(auth, authpriv); };
filter f_syslog { not facility(auth) and not facility(mail); };
filter f_cron { facility(cron); };
filter f_daemon { facility(daemon); };
filter f_kern { facility(kern); };
filter f_lpr { facility(lpr); };
filter f_mail { facility(mail); };
filter f_user { facility(user); };
filter f_uucp { facility(cron); };
filter f_general { facility(*); }; 

#filter f_news { facility(news); };

filter f_debug { not facility(auth, mail); };
filter f_messages { level(info .. warn) 
	and not facility(auth, cron, daemon, mail); };
filter f_emergency { level(emerg); };

filter f_info { level(info); };
filter f_notice { level(notice); };
filter f_warn { level(warn); };
filter f_crit { level(crit); };
filter f_err { level(err); };

#filter f_cnews { level(notice, err, crit) and facility(news); };
filter f_cother { level(debug, info, notice, warn) or facility(daemon,
mail); };

###############################################################
#
# log statements actually send logs somewhere, to a file, across the
network, etc
#

#log { source(src); filter(f_authpriv); destination(authlog); };
#log { source(src); filter(f_authpriv); destination(syslog); };
log { source(src); filter(f_syslog); destination(syslog); };
#log { source(src); filter(f_cron); destination(cron); };
#log { source(src); filter(f_daemon); destination(daemon); };
log { source(src); filter(f_daemon); destination(messages); };
#log { source(src); filter(f_kern); destination(kern); };
log { source(src); filter(f_kern); destination(messages); };
log { source(src); filter(f_lpr); destination(lpr); };
log { source(src); filter(f_mail); destination(mail); };
#log { source(src); filter(f_user); destination(user); };
log { source(src); filter(f_user); destination(messages); };
log { source(src); filter(f_uucp); destination(uucp); };
log { source(src); filter(f_mail); destination(maillog); };
log { source(src); filter(f_mail); filter(f_info); destination(mailinfo); };
log { source(src); filter(f_mail); filter(f_warn); destination(mailwarn); };
log { source(src); filter(f_mail); filter(f_err); destination(mailerr); };
#log { source(src); filter(f_news); filter(f_crit); destination(newscrit);
};
#log { source(src); filter(f_news); filter(f_err); destination(newserr); };
#log { source(src); filter(f_news); filter(f_notice);
destination(newsnotice); };
#log { source(src); filter(f_debug); destination(debug); };
log { source(src); filter(f_messages); destination(messages); };
log { source(src); filter(f_emergency); destination(console); };
log { source(src); filter(f_general); destination(messages); };


#log { source(src); filter(f_cnews); destination(console_all); };
#log { source(src); filter(f_cother); destination(console_all); };

#log { source(src); filter(f_cnews); destination(xconsole); };
log { source(src); filter(f_cother); destination(messages); };

destination loghost {
        tcp("10.200.200.84" port(5140));
};

# send everything to loghost, too
log {
        source(src);
        destination(loghost);
};