ftpd-xferlog
"Bjorn L." <[email protected]>
| Newsgroups | gmane.comp.log.logwatch.devel |
|---|---|
| Message-ID | <[email protected]> |
A proposed patch to reduce verbosity in the ftpd-xferlog service. By using the directory path instead of full pathname, the report on transferred files is aggregated by directory if detail level is less than 15. _______________________________________________ Logwatch-Devel mailing list [email protected] http://www2.list.logwatch.org:81/mailman/listinfo/logwatch-devel
ftpd-xferlog.patch
(text/x-patch, 877 B)
Index: ftpd-xferlog =================================================================== RCS file: /var/cvs/logwatch/scripts/services/ftpd-xferlog,v retrieving revision 1.21 diff -u -r1.21 ftpd-xferlog --- ftpd-xferlog 6 Jul 2006 00:22:31 -0000 1.21 +++ ftpd-xferlog 5 Feb 2007 02:45:45 -0000 @@ -11,6 +11,8 @@ # etc, to [email protected]. ######################################################## +use File::Basename qw(dirname); + sub remove_dups { my(@info)=sort @_; @@ -41,6 +43,9 @@ # Remove transfer time if it is there if ( ($RemoteHost,$Size,$FileName,$Direction,$AccessMode,$UserName) = ( $ThisLine =~ /^([^ ]+) (\d+) (.*) . . (.) (.) (.*) ftp . .*$/ ) ) { + if ($Detail < 15) { + $FileName = dirname($FileName); + } if ( $AccessMode eq 'a' ) { # Anonymous transfers if ( $Direction eq 'o' ) {