Add TopDenied configuration directive to be able to show more denied URL

than in other reports.
This commit is contained in:
Gilles Darold 2019-01-01 22:37:08 +01:00
parent 46e74146ae
commit 143dc649d1
4 changed files with 15 additions and 3 deletions

4
README
View File

@ -427,6 +427,10 @@ CONFIGURATION
Used to set the number of top url and second level domain to show. Used to set the number of top url and second level domain to show.
Default is top 100. Default is top 100.
TopDenied number
Used to set the number of top denied url to show. Default is top
100.
TopStorage number TopStorage number
Top number of url to preserve on each data file sorted by OrderUrl. Top number of url to preserve on each data file sorted by OrderUrl.
On huge access log it will improve a lot the performances but you On huge access log it will improve a lot the performances but you

View File

@ -1707,6 +1707,7 @@ sub _init
$self->{CostPrice} = $options{CostPrice} || 0; $self->{CostPrice} = $options{CostPrice} || 0;
$self->{Currency} = $options{Currency} || '€'; $self->{Currency} = $options{Currency} || '€';
$self->{TopNumber} = $options{TopNumber} || 10; $self->{TopNumber} = $options{TopNumber} || 10;
$self->{TopDenied} = $options{TopDenied} || 10;
$self->{TopStorage} = $options{TopStorage} || 0; $self->{TopStorage} = $options{TopStorage} || 0;
$self->{TransfertUnit} = $options{TransfertUnit} || 'BYTES'; $self->{TransfertUnit} = $options{TransfertUnit} || 'BYTES';
if (!grep(/^$self->{TransfertUnit}$/i, 'BYTES', 'KB', 'MB', 'GB')) { if (!grep(/^$self->{TransfertUnit}$/i, 'BYTES', 'KB', 'MB', 'GB')) {
@ -5102,7 +5103,6 @@ sub _print_user_denied_detail
} }
sub _print_top_url_stat sub _print_top_url_stat
{ {
my ($self, $outdir, $year, $month, $day, $week) = @_; my ($self, $outdir, $year, $month, $day, $week) = @_;
@ -5517,7 +5517,7 @@ sub _print_top_denied_stat
} }
my $t1 = $Translate{"Url_Hits_title"}; my $t1 = $Translate{"Url_Hits_title"};
$t1 =~ s/\%d/$self->{TopNumber}/; $t1 =~ s/\%d/$self->{TopDenied}/;
print $out $self->_print_title($t1, $stat_date, $week); print $out $self->_print_title($t1, $stat_date, $week);
print $out qq{ print $out qq{
@ -5599,7 +5599,7 @@ sub _print_top_denied_stat
<td>$bl</td> <td>$bl</td>
</tr>}; </tr>};
$i++; $i++;
last if ($i > $self->{TopNumber}); last if ($i > $self->{TopDenied});
} }
print $out qq{</tbody></table>}; print $out qq{</tbody></table>};

View File

@ -449,6 +449,11 @@ special character. Default is &euro;
Used to set the number of top url and second level domain to show. Used to set the number of top url and second level domain to show.
Default is top 100. Default is top 100.
=item TopDenied number
Used to set the number of top denied url to show.
Default is top 100.
=item TopStorage number =item TopStorage number
Top number of url to preserve on each data file sorted by OrderUrl. Top number of url to preserve on each data file sorted by OrderUrl.

View File

@ -81,6 +81,9 @@ Currency &euro;
# Top number of url to show from all url extracted from the log # Top number of url to show from all url extracted from the log
TopNumber 100 TopNumber 100
# Top number of denied URL to show
TopDenied 100
# Top number of url to preserve on each data file sorted by OrderUrl. # Top number of url to preserve on each data file sorted by OrderUrl.
# On huge access log it will improve a lot the performances but you # On huge access log it will improve a lot the performances but you
# will have less precision in the top url. Default to 0, all url will # will have less precision in the top url. Default to 0, all url will