Commit b56abec7 authored by taggart's avatar taggart

new script to detect bulk adding

parent eae67c8c
#!/usr/bin/perl -w
# bulkdetect - spot owners/lists bulk adding lots of subscribers
# taggart 2019-06
$log='/var/log/sympa/wwsympa.log';
open(LOG, "$log") or die "cannot open log\n";
while (<LOG>) {
chomp;
if ( m/.*\[user (.*)\] \[list (.*)\] main::do_add\(\) do_add:(.+)/ ) {
#print "$1 $2 $3\n";
# hash key is owner:list, value is number of attempts to add
$result{"$1:$2"}++;
}
}
format Foo =
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @>>>>>>
$owner, $list $count
.
# set output format
$~= 'Foo';
# print header
$owner = 'Owner adding';
$list = 'List';
$count = 'Add';
write;
foreach $key ( sort { $result{$b} <=> $result{$a} } keys %result) {
($owner,$list) = split /:/,$key;
$count = $result{$key};
write;
}
## Notes
#if ( m/.*\[user (.*)\] \[list (.*)\] main::do_add\(\) do_add: (.*)/ ) {
# do_add sometimes returns the following things, might be interesting to look for
# already subscriber
# no email
# incorrect email
# may not add
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment