diff options
author | Andrew Lewis <nerf@judo.za.org> | 2021-09-01 13:56:59 +0200 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2021-09-01 16:37:12 +0200 |
commit | 7329a9a149edda7de45c5d7d4b290055ab2969ef (patch) | |
tree | 32bf793c628f5c2b855751fcae43f4194ece6d78 /utils | |
parent | 760522c4da986f19e864da6123ba938f5e7d25d2 (diff) | |
download | rspamd-7329a9a149edda7de45c5d7d4b290055ab2969ef.tar.gz rspamd-7329a9a149edda7de45c5d7d4b290055ab2969ef.zip |
[Minor] rspamd_stats: support rescoring symbols
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/rspamd_stats.pl | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/utils/rspamd_stats.pl b/utils/rspamd_stats.pl index b0084c93a..e90524d20 100755 --- a/utils/rspamd_stats.pl +++ b/utils/rspamd_stats.pl @@ -14,6 +14,7 @@ my @symbols_exclude; my @symbols_bidirectional; my @symbols_groups; my @symbols_ignored; +my %symbols_mult; my %groups; my $reject_score = 15.0; my $junk_score = 6.0; @@ -47,6 +48,7 @@ GetOptions( "ignore=s@" => \@symbols_ignored, "group|g=s@" => \@symbols_groups, "log|l=s" => \$log_file, + "mult=s" => \%symbols_mult, "alpha-score|alpha|a=f" => \$diff_alpha, "correlations|c" => \$correlations, "nrelated=i" => \$nrelated, @@ -427,7 +429,7 @@ sub ProcessRelated { next if IsIgnored($sym_name); if ($2) { - $sym_score = $3 * 1.0; + $sym_score = $3 * ($symbols_mult{$sym_name} or 1.0); if ( abs($sym_score) < $diff_alpha ) { next; @@ -549,7 +551,7 @@ sub ProcessLog { my $orig_name = $sym_name; if ($2) { - $sym_score = $3 * 1.0; + $sym_score = $3 * ($symbols_mult{$sym_name} or 1.0); if ( abs($sym_score) < $diff_alpha ) { next; @@ -868,6 +870,7 @@ rspamd_stats [options] [--symbol=SYM1 [--symbol=SYM2...]] [--log file] --exclude-logs=integer number of latest logs to exclude (0 by default) --json print json output instead of human readable --help brief help message + --mult=sym=number multiply symbol score --man full documentation =head1 OPTIONS @@ -932,6 +935,10 @@ Select log entries before this time. Format: C<YYYY-MM-DD HH:MM:SS> (can be trun with B<--start> select entries between B<--start> and B<--end>. The omitted date defaults to the current date if you supply the time. +=item B<--mult=symbol=number> + +Multiplies score for the named symbol by the provided multiplier. + =item B<--help> Print a brief help message and exits. |