# syslog-ng configuration file. # # # See syslog-ng(8) and syslog-ng.conf(5) for more information. # # n3on@dc.lv # ### Global options options { sync (0); time_reopen (10); time_reap (10); log_fifo_size (1000); long_hostnames (off); use_dns (no); use_fqdn (no); create_dirs (yes); keep_hostname (no); owner(syslog-ng); group(syslog-ng); }; ### Source drivers source src_kernel { pipe ("/proc/kmsg"); }; source src_syslog-ng { internal (); }; source src_local { unix-stream ("/dev/log"); }; ### Destination drivers destination dst_kernel { file ( "/var/log/localhost/$DAY.$MONTH.$YEAR/kernel.log" template("[$WEEKDAY $HOUR:$MIN:$SEC] $MESSAGE [$LEVEL]\n") template_escape(no) ); }; destination dst_syslog-ng { file ( "/var/log/localhost/$DAY.$MONTH.$YEAR/syslog-ng.log" template("[$WEEKDAY $HOUR:$MIN:$SEC] $MESSAGE [$LEVEL]\n") template_escape(no) ); }; destination dst_sshd { file ( "/var/log/localhost/$DAY.$MONTH.$YEAR/sshd.log" template("[$WEEKDAY $HOUR:$MIN:$SEC] $MESSAGE [$LEVEL]\n") template_escape(no) ); }; destination dst_fcron { file ( "/var/log/localhost/$DAY.$MONTH.$YEAR/fcron.log" template("[$WEEKDAY $HOUR:$MIN:$SEC] $MESSAGE [$LEVEL]\n") template_escape(no) ); }; destination dst_remain { file ( "/var/log/localhost/$DAY.$MONTH.$YEAR/remaining.log" template("[$WEEKDAY $HOUR:$MIN:$SEC] $MESSAGE [$LEVEL]\n") template_escape(no) ); }; destination dst_rpm-list { file ( "/var/log/localhost/$DAY.$MONTH.$YEAR/rpm-list.log" template("$MESSAGE\n") template_escape(no) ); }; destination dst_ntpd { file ( "/var/log/localhost/$DAY.$MONTH.$YEAR/ntpd.log" template("[$WEEKDAY $HOUR:$MIN:$SEC] $MESSAGE [$LEVEL]\n") template_escape(no) ); }; destination dst_scripts { file ( "/var/log/localhost/$DAY.$MONTH.$YEAR/scripts.log" template("[$WEEKDAY $HOUR:$MIN:$SEC] $MESSAGE [$LEVEL]\n") template_escape(no) ); }; destination dst_debug { file ( "/var/log/localhost/$DAY.$MONTH.$YEAR/debug.log" template("[$WEEKDAY $HOUR:$MIN:$SEC] $MESSAGE [$LEVEL - $FACILITY]\n") template_escape(no) ); }; destination dst_net { tcp ( "10.148.62.9" port(666) ); }; ### Filters filter fltr_sshd { program("sshd"); }; filter fltr_fcron { program("fcron"); }; filter fltr_syslog-ng { program("syslog-ng"); }; filter fltr_rpm-list { program("rpm"); }; filter fltr_ntpd { program("ntpd"); }; filter fltr_scripts { program("script"); }; filter fltr_remain { (not program("sshd")) and (not program("fcron")) and (not program("syslog-ng")) and (not program("rpm")) and (not program("script")) and (not program("ntpd"));}; ### Logs log { source(src_kernel); destination(dst_kernel); }; log { source(src_syslog-ng); source(src_local); filter(fltr_syslog-ng); destination(dst_syslog-ng); }; log { source(src_local); filter(fltr_sshd); destination(dst_sshd); }; log { source(src_local); filter(fltr_fcron); destination(dst_fcron); }; log { source(src_local); filter(fltr_rpm-list); destination(dst_rpm-list); }; log { source(src_local); filter(fltr_ntpd); destination(dst_ntpd); }; log { source(src_local); filter(fltr_scripts); destination(dst_scripts); }; log { source(src_local); filter(fltr_remain); destination(dst_remain); }; log { source(src_kernel); source(src_syslog-ng); source(src_local); destination(dst_debug); }; log { source(src_kernel); source(src_syslog-ng); source(src_local); destination(dst_net); };