I'm trying to compact the syslog entries from vsftpd with logwatch, to get from:
vsftpd: pam_succeed_if(vsftpd:auth): error retrieving information about user Administrator
vsftpd: pam_succeed_if(vsftpd:auth): error retrieving information about user Administrator
vsftpd: pam_succeed_if(vsftpd:auth): error retrieving information about user Administrator
vsftpd: pam_succeed_if(vsftpd:auth): error retrieving information about user Administrator
vsftpd: pam_succeed_if(vsftpd:auth): error retrieving information about user Administrator
... many many times
to
vsftpd: pam_succeed_if(vsftpd:auth): error retrieving information about user Administrator : 125 time(s)
How can I do that?
What version and distribution of Linux/Unix are you using and what version is logwatch? I am running Redhat 4 - logwatch 5.2.2, and in my vsftp script (/etc/log.d/scripts/services/vsftp) there is the following:
Earlier in the script it sums the failures for each user.
Upgrade logwatch. Newer logwatch scripts automatically do that.
uniq will do this for you: I don't think you can control the format, but you could easily fix that with awk.
I'm assuming you don't care about timestamps, which you don't have on your examples.