Skip to content
Snippets Groups Projects
Commit b56abec7 authored by taggart's avatar taggart
Browse files

new script to detect bulk adding

parent eae67c8c
Branches
No related tags found
No related merge requests found
#!/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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment