my $diff_alpha = 0.1;
my $correlations = 0;
my $log_file = "";
+my $search_pattern = "";
my $man = 0;
my $help = 0;
"log|l=s" => \$log_file,
"alpha|a=f" => \$diff_alpha,
"correlations|c" => \$correlations,
+ "search-pattern=s" => \$search_pattern,
"help|?" => \$help,
"man" => \$man
) or pod2usage(2);
my $ham_junk_change = 0;
my %sym_res;
my $rspamd_log;
+my $enabled = 0;
if ($log_file eq '-' || $log_file eq '') {
$rspamd_log = \*STDIN;
}
while(<$rspamd_log>) {
+ if (!$enabled && ($search_pattern eq "" || /$search_pattern/)) {
+ $enabled = 1;
+ }
+
+ next if !$enabled;
+
if (/^.*rspamd_task_write_log.*$/) {
my @elts = split /\s+/;
my $ts = $elts[0] . ' ' . $elts[1];
--junk-score=score set junk score (6.0 by default)
--symbol=sym check specified symbol (perl regexps, '.*' by default)
--alpha=value set ignore score for symbols (0.1 by default)
+ --correlations enable correlations report
+ --search-pattern do not process input unless the desired pattern is found
--help brief help message
--man full documentation
Add symbol or pattern (pcre format) to analyze.
+=item B<--correlations>
+
+Additionaly print correlation rate for each symbol displayed. This routine calculates merely paired correlations between symbols.
+
+=item B<--search-pattern>
+
+Do not process input unless finding the specified regular expression. Useful to skip logs to certain date, for example, --search-pattern="2016-08-09 10:00:0[0-9]"
+
=item B<--help>
Print a brief help message and exits.