$lowerval
$PluginMode
$TotalUnique $TotalVisits $TotalHostsKnown $TotalHostsUnknown
-$TotalPages $TotalHits $TotalBytes $TotalEntries $TotalExits $TotalBytesPages $TotalDifferentPages
+$TotalPages $TotalHits $TotalBytes
+$TotalNotViewedPages $TotalNotViewedHits $TotalNotViewedBytes
+$TotalEntries $TotalExits $TotalBytesPages $TotalDifferentPages
$TotalKeyphrases $TotalKeywords $TotalDifferentKeyphrases $TotalDifferentKeywords
$TotalSearchEnginesPages $TotalSearchEnginesHits $TotalRefererPages $TotalRefererHits $TotalDifferentSearchEngines $TotalDifferentReferer
$FrameName $Center $FileConfig $FileSuffix $Host $DayRequired $MonthRequired $YearRequired
$lowerval = 0;
$PluginMode = '';
$TotalUnique = $TotalVisits = $TotalHostsKnown = $TotalHostsUnknown = 0;
-$TotalPages = $TotalHits = $TotalBytes = $TotalEntries = $TotalExits = $TotalBytesPages = $TotalDifferentPages = 0;
+$TotalPages = $TotalHits = $TotalBytes = 0;
+$TotalNotViewedPages = $TotalNotViewedHits = $TotalNotViewedBytes = 0;
+$TotalEntries = $TotalExits = $TotalBytesPages = $TotalDifferentPages = 0;
$TotalKeyphrases = $TotalKeywords = $TotalDifferentKeyphrases = $TotalDifferentKeywords = 0;
$TotalSearchEnginesPages = $TotalSearchEnginesHits = $TotalRefererPages = $TotalRefererHits = $TotalDifferentSearchEngines = $TotalDifferentReferer = 0;
($FrameName, $Center, $FileConfig, $FileSuffix, $Host, $DayRequired, $MonthRequired, $YearRequired,
@BrowsersSearchIDOrder @OSSearchIDOrder @WordsToExtractSearchUrl @WordsToCleanSearchUrl
@WormsSearchIDOrder
@RobotsSearchIDOrder @SearchEnginesSearchIDOrder
-@_from_p @_from_h @_time_p @_time_h @_time_k
+@_from_p @_from_h
+@_time_p @_time_h @_time_k @_time_nv_p @_time_nv_h @_time_nv_k
@DOWIndex @fieldlib @keylist
/;
@RobotsSearchIDOrder = @SearchEnginesSearchIDOrder = ();
-@_from_p = @_from_h = @_time_p = @_time_h = @_time_k = ();
+@_from_p = @_from_h = ();
+@_time_p = @_time_h = @_time_k = @_time_nv_p = @_time_nv_h = @_time_nv_k = ();
@DOWIndex = @fieldlib = @keylist = ();
use vars qw/
@MiscListOrder %MiscListCalc
%TmpDNSLookup = %TmpOS = %TmpRefererServer = %TmpRobot = %TmpBrowser = %MyDNSTable = ();
use vars qw/
%FirstTime %LastTime
-%MonthUnique %MonthVisits %MonthPages %MonthHits %MonthBytes %MonthHostsKnown %MonthHostsUnknown
+%MonthHostsKnown %MonthHostsUnknown
+%MonthUnique %MonthVisits
+%MonthPages %MonthHits %MonthBytes
+%MonthNotViewedPages %MonthNotViewedHits %MonthNotViewedBytes
%_session %_browser_h
%_domener_p %_domener_h %_domener_k %_errors_h %_errors_k
%_filetypes_h %_filetypes_k %_filetypes_gz_in %_filetypes_gz_out
'Codes shown here gave hits or traffic "not viewed" by visitors, so they are not included in other charts.',
'Cluster',
'Robots shown here gave hits or traffic "not viewed" by visitors, so they are not included in other charts.',
-'Numbers after + are successful hits on "robots.txt" files'
+'Numbers after + are successful hits on "robots.txt" files',
+'Worms shown here gave hits or traffic "not viewed" by visitors, so thay are not included in other charts.',
+'Not viewed trafic is trafic generated by robots, worms or answers with special HTTP status code',
+'Traffic viewed',
+'Traffic not viewed',
+'Monthly history'
);
}
print "\n";
if ($FrameName ne 'index') {
- if ($BuildReportFormat eq 'html') { print "<br />\n"; }
+ if ($FrameName ne 'mainleft' && $BuildReportFormat eq 'html') { print "<br />\n"; }
print "</body>\n";
}
print "</html>\n";
# BEGIN_TIME
if ($field[0] eq 'BEGIN_TIME') {
my $monthpages=0;my $monthhits=0;my $monthbytes=0;
+ my $monthnotviewedpages=0;my $monthnotviewedhits=0;my $monthnotviewedbytes=0;
if ($Debug) { debug(" Begin of TIME section"); }
$field[0]='';
my $count=0;my $countloaded=0;
if ($field[1]) { $_time_p[$field[0]]+=int($field[1]); }
if ($field[2]) { $_time_h[$field[0]]+=int($field[2]); }
if ($field[3]) { $_time_k[$field[0]]+=int($field[3]); }
+ if ($field[4]) { $_time_nv_p[$field[0]]+=int($field[4]); }
+ if ($field[5]) { $_time_nv_h[$field[0]]+=int($field[5]); }
+ if ($field[6]) { $_time_nv_k[$field[0]]+=int($field[6]); }
}
$monthpages+=int($field[1]);
$monthhits+=int($field[2]);
$monthbytes+=int($field[3]);
+ $monthnotviewedpages+=int($field[4]||0);
+ $monthnotviewedhits+=int($field[5]||0);
+ $monthnotviewedbytes+=int($field[6]||0);
}
}
$_=<HISTORY>;
$MonthPages{$year.$month}+=$monthpages;
$MonthHits{$year.$month}+=$monthhits;
$MonthBytes{$year.$month}+=$monthbytes;
+ $MonthNotViewedPages{$year.$month}+=$monthnotviewedpages;
+ $MonthNotViewedHits{$year.$month}+=$monthnotviewedhits;
+ $MonthNotViewedBytes{$year.$month}+=$monthnotviewedbytes;
delete $SectionsToLoad{'time'};
if ($SectionsToSave{'time'}) {
Save_History('time',$year,$month); delete $SectionsToSave{'time'};
- if ($withpurge) { @_time_p=(); @_time_h=(); @_time_k=(); }
+ if ($withpurge) { @_time_p=(); @_time_h=(); @_time_k=(); @_time_nv_p=(); @_time_nv_h=(); @_time_nv_k=(); }
}
if (! scalar %SectionsToLoad) { debug(" Stop reading history file. Got all we need."); last; }
next;
# When
if ($sectiontosave eq 'time') {
print HISTORYTMP "\n";
- print HISTORYTMP "# Hour - Pages - Hits - Bandwidth\n";
+ print HISTORYTMP "# Hour - Pages - Hits - Bandwidth - Not viewed Pages - Not viewed Hits - Not viewed Bandwidth\n";
$ValueInFile{$sectiontosave}=tell HISTORYTMP;
print HISTORYTMP "BEGIN_TIME 24\n";
- for (my $ix=0; $ix<=23; $ix++) { print HISTORYTMP "$ix ".int($_time_p[$ix])." ".int($_time_h[$ix])." ".int($_time_k[$ix])."\n"; }
+ for (my $ix=0; $ix<=23; $ix++) { print HISTORYTMP "$ix ".int($_time_p[$ix])." ".int($_time_h[$ix])." ".int($_time_k[$ix])." ".int($_time_nv_p[$ix])." ".int($_time_nv_h[$ix])." ".int($_time_nv_k[$ix])."\n"; }
print HISTORYTMP "END_TIME\n";
}
if ($sectiontosave eq 'day') { # This section must be saved after VISITOR section is read
if ($Debug) { debug("Call to Init_HashArray"); }
# Reset global hash arrays
%FirstTime = %LastTime = ();
+ %MonthHostsKnown = %MonthHostsUnknown = ();
%MonthVisits = %MonthUnique = ();
%MonthPages = %MonthHits = %MonthBytes = ();
- %MonthHostsKnown = %MonthHostsUnknown = ();
+ %MonthNotViewedPages = %MonthNotViewedHits = %MonthNotViewedBytes = ();
%DayPages = %DayHits = %DayBytes = %DayVisits = ();
# Reset all arrays with name beginning by _
for (my $ix=0; $ix<6; $ix++) { $_from_p[$ix]=0; $_from_h[$ix]=0; }
- for (my $ix=0; $ix<24; $ix++) { $_time_h[$ix]=0; $_time_k[$ix]=0; $_time_p[$ix]=0; }
+ for (my $ix=0; $ix<24; $ix++) { $_time_h[$ix]=0; $_time_k[$ix]=0; $_time_p[$ix]=0; $_time_nv_h[$ix]=0; $_time_nv_k[$ix]=0; $_time_nv_p[$ix]=0; }
# Reset all hash arrays with name beginning by _
%_session = %_browser_h = ();
%_domener_p = %_domener_h = %_domener_k = %_errors_h = %_errors_k = ();
# Now @dateparts is (DD,MM,YYYY,HH,MM,SS) and we're going to create $timerecord=YYYYMMDDHHMMSS
# Plugin call : Convert a @datepart into another @datepart
if ($PluginsLoaded{'ChangeTime'}{'timezone'}) { @dateparts=ChangeTime_timezone(\@dateparts); }
- my $yearmonthdayrecord=sprintf("$dateparts[2]%02i%02i",$dateparts[1],$dateparts[0]);
- my $timerecord=((int("$yearmonthdayrecord")*100+$dateparts[3])*100+$dateparts[4])*100+$dateparts[5];
my $yearrecord=int($dateparts[2]);
my $monthrecord=int($dateparts[1]);
+ my $hourrecord=int($dateparts[3]);
+ my $yearmonthdayrecord=sprintf("$dateparts[2]%02i%02i",$dateparts[1],$dateparts[0]);
+ my $timerecord=((int("$yearmonthdayrecord")*100+$dateparts[3])*100+$dateparts[4])*100+$dateparts[5];
# Check date
#-----------------------
# Convert $field[$pos_size]
# if ($field[$pos_size] eq '-') { $field[$pos_size]=0; }
- # Check misc tracker (must be before return code)
- #------------------------------------------------
- if ($field[$pos_url] =~ /$MiscTrackerUrl/o) {
+ # Define a clean target URL and referrer URL
+ # We keep a clean $field[$pos_url] and
+ # we store original value for urlwithnoquery, tokenquery and standalonequery
+ #---------------------------------------------------------------------------
+ if ($URLNotCaseSensitive) { $field[$pos_url]=lc($field[$pos_url]); }
+ # Possible URL syntax for $field[$pos_url]: /mydir/mypage.ext?param1=x¶m2=y#aaa, /mydir/mypage.ext#aaa, /
+ my $urlwithnoquery; my $tokenquery; my $standalonequery; my $anchor='';
+ if ($field[$pos_url] =~ s/$regtruncanchor//o) { $anchor=$1; } # Remove and save anchor
+ if ($URLWithQuery) {
+ $urlwithnoquery=$field[$pos_url];
+ my $foundparam=($urlwithnoquery =~ s/$regtruncurl//o);
+ $tokenquery=$1||'';
+ $standalonequery=$2||'';
+ # For IIS setup, if pos_query is enabled we need to combine the URL to query strings
+ if (! $foundparam && $pos_query >=0 && $field[$pos_query] && $field[$pos_query] ne '-') {
+ $foundparam=1;
+ $tokenquery='?';
+ $standalonequery=$field[$pos_query];
+ # Define query
+ $field[$pos_url] .= '?'.$field[$pos_query];
+ }
+ if ($foundparam) {
+ # Keep only params that are defined in URLWithQueryWithOnlyFollowingParameters
+ my $newstandalonequery='';
+ if (@URLWithQueryWithOnly) {
+ foreach (@URLWithQueryWithOnly) {
+ foreach my $p (split(/&/,$standalonequery)) {
+ if ($URLNotCaseSensitive) { if ($p =~ /^$_=/i) { $newstandalonequery.="$p&"; last; } }
+ else { if ($p =~ /^$_=/) { $newstandalonequery.="$p&"; last; } }
+ }
+ }
+ chop $newstandalonequery;
+ }
+ # Remove params that are marked to be ignored in URLWithQueryWithoutFollowingParameters
+ elsif (@URLWithQueryWithout) {
+ foreach my $p (split(/&/,$standalonequery)) {
+ my $found=0;
+ foreach (@URLWithQueryWithout) {
+ #debug(" Check if '$_=' is param '$p' to remove it from query",5);
+ if ($URLNotCaseSensitive) { if ($p =~ /^$_=/i) { $found=1; last; } }
+ else { if ($p =~ /^$_=/) { $found=1; last; } }
+ }
+ if (! $found) { $newstandalonequery.="$p&"; }
+ }
+ chop $newstandalonequery;
+ }
+ else { $newstandalonequery=$standalonequery; }
+ # Define query
+ $field[$pos_url]=$urlwithnoquery;
+ if ($newstandalonequery) { $field[$pos_url].="$tokenquery$newstandalonequery"; }
+ }
+ }
+ else {
+ # Trunc parameters of URL
+ $field[$pos_url] =~ s/$regtruncurl//o;
+ $urlwithnoquery=$field[$pos_url];
+ $tokenquery=$1||'';
+ $standalonequery=$2||'';
+ }
+ if ($URLWithAnchor && $anchor) { $field[$pos_url].="#$anchor"; } # Restore anchor
+ # Here now urlwithnoquery is /mydir/mypage.ext, /mydir, /, /page#XXX
+ # Here now tokenquery is '' or '?' or ';'
+ # Here now standalonequery is '' or 'param1=x'
+
+ # Define page and extension
+ #--------------------------
+ my $PageBool=1;
+ # Extension
+ my $extension;
+ if ($urlwithnoquery =~ /$regext/o || ($urlwithnoquery =~ /[\\\/]$/ && $DefaultFile[0] =~ /$regext/o)) {
+ $extension=($LevelForFileTypesDetection>=2 || $MimeHashFamily{$1})?lc($1):'Unknown';
+ if ($NotPageList{$extension}) { $PageBool=0; }
+ }
+ else {
+ $extension='Unknown';
+ }
+
+ # Analyze: misc tracker (must be before return code)
+ #---------------------------------------------------
+ if ($urlwithnoquery =~ /$MiscTrackerUrl/o) {
my $query=$field[$pos_url];
- if ($pos_query >=0 && $field[$pos_query]) { $query=$field[$pos_query]; } # For this fucking IIS in pos_query mode
my $foundparam=0;
- foreach (split(/&/,$query)) {
+ foreach (split(/&/,$standalonequery)) {
if ($_ =~ /SCREEN=(\d+)x(\d+)/) { $foundparam++; $_screensize_h{"$1x$2"}++; next; }
# if ($_ =~ /CDI=(\d+)/) { $foundparam++; $_screendepth_h{"$1"}++; next; }
if ($_ =~ /JAVA=(\w+)/) { $foundparam++; if ($1 eq 'true') { $_misc_h{"JavaEnabled"}++; } next; }
}
if ($foundparam) { $_misc_h{"TotalMisc"}++; }
}
- # Check favicon
- #-----------------------------------------------
- elsif ($field[$pos_url] =~ /\/favicon\.ico$/i) {
- if (($field[$pos_code] != 404 || $field[$pos_url] !~ /\/.+\/favicon\.ico$/i) && ($field[$pos_agent] =~ /MSIE/)) {
+
+ # Analyze: favicon
+ #-----------------
+ if ($urlwithnoquery =~ /\/favicon\.ico$/i) {
+ if (($field[$pos_code] != 404 || $urlwithnoquery !~ /\/.+\/favicon\.ico$/i) && ($field[$pos_agent] =~ /MSIE/)) {
# We don't count one hit if (not on root and error) and MSIE
# If error not on root, another hit will be made on root. If not MSIE, hit are made not only for "Adding".
$_misc_h{'AddToFavourites'}++; # Hit on favicon on root or without error, we count it
if ($LevelForWormsDetection) {
foreach (@WormsSearchIDOrder) {
if ($field[$pos_url] =~ /$_/) {
+ # It's a worm
my $worm=$WormsHashID{$_};
$_worm_h{$worm}++;
$_worm_k{$worm}+=int($field[$pos_size]);
$_worm_l{$worm}=$timerecord;
$countedtraffic=1;
+ if ($PageBool) { $_time_nv_p[$hourrecord]++; }
+ $_time_nv_h[$hourrecord]++;
+ $_time_nv_k[$hourrecord]+=int($field[$pos_size]);
last;
}
}
}
- # Check return status code
- #-------------------------
+ # Analyze: Status code
+ #---------------------
if (! $countedtraffic) {
if ($LogType eq 'W' || $LogType eq 'S') { # HTTP record or Stream record
if ($ValidHTTPCodes{$field[$pos_code]}) { # Code is valid
}
if ($Debug) { debug(" Record stored in the status code chart (status code=$field[$pos_code])",2); }
$countedtraffic=1;
+ if ($PageBool) { $_time_nv_p[$hourrecord]++; }
+ $_time_nv_h[$hourrecord]++;
+ $_time_nv_k[$hourrecord]+=int($field[$pos_size]);
}
}
elsif ($LogType eq 'M') { # Mail record
if (! $ValidSMTPCodes{$field[$pos_code]}) { # Code is not valid
$_errors_h{$field[$pos_code]}++;
#$_errors_k{$field[$pos_code]}+=int($field[$pos_size]); # Useless since pos_size is often 0 or ? when error
+ if ($Debug) { debug(" Record stored in the status code chart (status code=$field[$pos_code])",2); }
$countedtraffic=1;
+ if ($PageBool) { $_time_nv_p[$hourrecord]++; }
+ $_time_nv_h[$hourrecord]++;
+ $_time_nv_k[$hourrecord]+=int($field[$pos_size]);
}
}
elsif ($LogType eq 'F') { # FTP record
$_robot_h{$uarobot}++;
$_robot_k{$uarobot}+=int($field[$pos_size]);
$_robot_l{$uarobot}=$timerecord;
- if ($field[$pos_url] =~ /$regrobot/o) { $_robot_r{$uarobot}++; }
+ if ($urlwithnoquery =~ /$regrobot/o) { $_robot_r{$uarobot}++; }
$countedtraffic=1;
+ if ($PageBool) { $_time_nv_p[$hourrecord]++; }
+ $_time_nv_h[$hourrecord]++;
+ $_time_nv_k[$hourrecord]+=int($field[$pos_size]);
}
}
}
# It's not a known robot or robot detection disabled. Check if hit on robots.txt file
- if ($field[$pos_url] =~ /$regrobot/o) {
+ if ($urlwithnoquery =~ /$regrobot/o) {
if ($Debug) { debug(" It's an unknown robot",2); }
$_robot_h{'unknown'}++;
$_robot_k{'unknown'}+=int($field[$pos_size]);
$_robot_l{'unknown'}=$timerecord;
$_robot_r{'unknown'}++;
$countedtraffic=1;
+ if ($PageBool) { $_time_nv_p[$hourrecord]++; }
+ $_time_nv_h[$hourrecord]++;
+ $_time_nv_k[$hourrecord]+=int($field[$pos_size]);
}
}
- # Define a clean target URL and referrer URL
- # We keep a clean $field[$pos_url] and
- # we store original value for urlwithnoquery, tokenquery and standalonequery
- #---------------------------------------------------------------------------
- if ($URLNotCaseSensitive) { $field[$pos_url]=lc($field[$pos_url]); }
- # Possible URL syntax for $field[$pos_url]: /mydir/mypage.ext?param1=x¶m2=y#aaa, /mydir/mypage.ext#aaa, /
- my $urlwithnoquery; my $tokenquery; my $standalonequery; my $anchor='';
- if ($field[$pos_url] =~ s/$regtruncanchor//o) { $anchor=$1; } # Remove and save anchor
- if ($URLWithQuery) {
- $urlwithnoquery=$field[$pos_url];
- my $foundparam=($urlwithnoquery =~ s/$regtruncurl//o);
- $tokenquery=$1||'';
- $standalonequery=$2||'';
- # For IIS setup, if pos_query is enabled we need to combine the URL to query strings
- if (! $foundparam && $pos_query >=0 && $field[$pos_query] && $field[$pos_query] ne '-') {
- $foundparam=1;
- $tokenquery='?';
- $standalonequery=$field[$pos_query];
- # Define query
- $field[$pos_url] .= '?'.$field[$pos_query];
- }
- if ($foundparam) {
- # Keep only params that are defined in URLWithQueryWithOnlyFollowingParameters
- my $newstandalonequery='';
- if (@URLWithQueryWithOnly) {
- foreach (@URLWithQueryWithOnly) {
- foreach my $p (split(/&/,$standalonequery)) {
- if ($URLNotCaseSensitive) { if ($p =~ /^$_=/i) { $newstandalonequery.="$p&"; last; } }
- else { if ($p =~ /^$_=/) { $newstandalonequery.="$p&"; last; } }
- }
- }
- chop $newstandalonequery;
- }
- # Remove params that are marked to be ignored in URLWithQueryWithoutFollowingParameters
- elsif (@URLWithQueryWithout) {
- foreach my $p (split(/&/,$standalonequery)) {
- my $found=0;
- foreach (@URLWithQueryWithout) {
- #debug(" Check if '$_=' is param '$p' to remove it from query",5);
- if ($URLNotCaseSensitive) { if ($p =~ /^$_=/i) { $found=1; last; } }
- else { if ($p =~ /^$_=/) { $found=1; last; } }
- }
- if (! $found) { $newstandalonequery.="$p&"; }
- }
- chop $newstandalonequery;
- }
- else { $newstandalonequery=$standalonequery; }
- # Define query
- $field[$pos_url]=$urlwithnoquery;
- if ($newstandalonequery) { $field[$pos_url].="$tokenquery$newstandalonequery"; }
- }
- }
- else {
- # Trunc parameters of URL
- $field[$pos_url] =~ s/$regtruncurl//o;
- $urlwithnoquery=$field[$pos_url];
- $tokenquery=$1||'';
- $standalonequery=$2||'';
- }
- if ($URLWithAnchor && $anchor) { $field[$pos_url].="#$anchor"; } # Restore anchor
- # Here now urlwithnoquery is /mydir/mypage.ext, /mydir, /, /page#XXX
- # Here now tokenquery is '' or '?' or ';'
- # Here now standalonequery is '' or 'param1=x'
-
- # Define page and extension
- #--------------------------
- my $PageBool=1;
- # Extension
- my $extension;
- if ($urlwithnoquery =~ /$regext/o || ($urlwithnoquery =~ /[\\\/]$/ && $DefaultFile[0] =~ /$regext/o)) {
- $extension=($LevelForFileTypesDetection>=2 || $MimeHashFamily{$1})?lc($1):'Unknown';
- if ($NotPageList{$extension}) { $PageBool=0; }
- }
- else {
- $extension='Unknown';
- }
-
# Analyze: File type - Compression
#---------------------------------
if (! $countedtraffic) {
# Analyze: Date - Hour - Pages - Hits - Kilo
#-------------------------------------------
- my $hourrecord=int($dateparts[3]);
if ($PageBool) {
# Replace default page name with / only ('if' is to increase speed when only 1 value in @DefaultFile)
if (@DefaultFile > 1) { foreach my $elem (@DefaultFile) { if ($field[$pos_url] =~ s/\/$elem$/\//o) { last; } } }
$FirstTime{$lastprocessedyearmonth}||=$timerecord;
$LastTime{$lastprocessedyearmonth}=$timerecord;
$DayPages{$yearmonthdayrecord}++;
- $MonthPages{$lastprocessedyearmonth}++;
- $_time_p[$hourrecord]++; #Count accesses for hour (page)
+# $MonthPages{$lastprocessedyearmonth}++;
$_url_p{$field[$pos_url]}++; #Count accesses for page (page)
$_url_k{$field[$pos_url]}+=int($field[$pos_size]);
+ $_time_p[$hourrecord]++; #Count accesses for hour (page)
}
- $_time_h[$hourrecord]++; $MonthHits{$lastprocessedyearmonth}++; $DayHits{$yearmonthdayrecord}++; #Count accesses for hour (hit)
- $_time_k[$hourrecord]+=int($field[$pos_size]); $MonthBytes{$lastprocessedyearmonth}+=int($field[$pos_size]); $DayBytes{$yearmonthdayrecord}+=int($field[$pos_size]); #Count accesses for hour (kb)
-
+ $_time_h[$hourrecord]++;
+ $_time_k[$hourrecord]+=int($field[$pos_size]);
+ $DayHits{$yearmonthdayrecord}++; #Count accesses for hour (hit)
+ $DayBytes{$yearmonthdayrecord}+=int($field[$pos_size]); #Count accesses for hour (kb)
+# $MonthHits{$lastprocessedyearmonth}++;
+# $MonthBytes{$lastprocessedyearmonth}+=int($field[$pos_size]);
+
# Analyze: Login
#---------------
if ($pos_logname>=0 && $field[$pos_logname] && $field[$pos_logname] ne '-') {
if ($AuthenticatedUsersNotCaseSensitive) { $field[$pos_logname]=lc($field[$pos_logname]); }
# We found an authenticated user
- if ($PageBool) {
- $_login_p{$field[$pos_logname]}++; #Count accesses for page (page)
- }
+ if ($PageBool) { $_login_p{$field[$pos_logname]}++; } #Count accesses for page (page)
$_login_h{$field[$pos_logname]}++; #Count accesses for page (hit)
$_login_k{$field[$pos_logname]}+=int($field[$pos_size]); #Count accesses for page (kb)
$_login_l{$field[$pos_logname]}=$timerecord;
# Check cluster
#--------------
if ($pos_cluster>=0) {
- if ($PageBool) {
- $_cluster_p{$field[$pos_cluster]}++; #Count accesses for page (page)
- }
+ if ($PageBool) { $_cluster_p{$field[$pos_cluster]}++; } #Count accesses for page (page)
$_cluster_h{$field[$pos_cluster]}++; #Count accesses for page (hit)
$_cluster_k{$field[$pos_cluster]}+=int($field[$pos_size]); #Count accesses for page (kb)
}
$NewLinkParams =~ tr/&/&/s; $NewLinkParams =~ s/^&//; $NewLinkParams =~ s/&$//;
if ($NewLinkParams) { $NewLinkParams="${NewLinkParams}&"; }
- # Call to plugins' function AddHTMLBodyHeader
- foreach my $pluginname (keys %{$PluginsLoaded{'AddHTMLBodyHeader'}}) {
- my $function="AddHTMLBodyHeader_$pluginname()";
- eval("$function");
- }
-
if ($FrameName ne 'mainleft') {
# READING DATA
print "\n";
}
+ # Call to plugins' function AddHTMLBodyHeader
+ foreach my $pluginname (keys %{$PluginsLoaded{'AddHTMLBodyHeader'}}) {
+ my $function="AddHTMLBodyHeader_$pluginname()";
+ eval("$function");
+ }
+
# MENU
#---------------------------------------------------------------------
if ($ShowMenu || $FrameName eq 'mainleft') {
my $menuicon=0;
# Menu HTML
print "<table".($frame?" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"":"").">\n";
+ if ($ShowMonthStats) { print ($frame?"<tr><td class=\"awsm\">":""); print "<a href=\"$linkanchor#TOP\"$targetpage>$Message[128]</a>"; print ($frame?"</td></tr>\n":" "); }
# When
$linetitle=&AtLeastOneNotNull($ShowMonthStats,$ShowDaysOfMonthStats,$ShowDaysOfWeekStats,$ShowHoursStats);
if ($linetitle) { print "<tr><td class=\"awsm\" width=\"$WIDTHMENU1\"".($frame?"":" valign=\"top\"").">".($menuicon?"<img src=\"$DirIcons/other/menu4.png\" /> ":"")."<b>$Message[93]:</b></td>\n"; }
if ($linetitle) { print ($frame?"</tr>\n":"<td class=\"awsm\">"); }
- if ($ShowMonthStats) { print ($frame?"<tr><td class=\"awsm\">":""); print "<a href=\"$linkanchor#TOP\"$targetpage>$Message[128]</a>"; print ($frame?"</td></tr>\n":" "); }
+ if ($ShowMonthStats) { print ($frame?"<tr><td class=\"awsm\">":""); print "<a href=\"$linkanchor#month\"$targetpage>$Message[162]</a>"; print ($frame?"</td></tr>\n":" "); }
#if ($ShowMonthDayStats) { print ($frame?"<tr><td class=\"awsm\"> <img height=\"8\" width=\"9\" src=\"$DirIcons/other/page.png\" alt=\"...\" /> ":""); print "<a href=\"".($ENV{'GATEWAY_INTERFACE'} || !$StaticLinks?XMLEncode("$AWScript?${NewLinkParams}output=alldays"):"$PROG$StaticLinks.alldays.$StaticExt")."\"$NewLinkTarget>$Message[130]</a>\n"; print ($frame?"</td></tr>\n":" "); }
if ($ShowDaysOfMonthStats) { print ($frame?"<tr><td class=\"awsm\">":""); print "<a href=\"$linkanchor#daysofmonth\"$targetpage>$Message[138]</a>"; print ($frame?"</td></tr>\n":" "); }
if ($ShowDaysOfWeekStats) { print ($frame?"<tr><td class=\"awsm\">":""); print "<a href=\"$linkanchor#daysofweek\"$targetpage>$Message[91]</a>"; print ($frame?"</td></tr>\n":" "); }
# FirstTime LastTime TotalVisits TotalUnique TotalPages TotalHits TotalBytes TotalHostsKnown TotalHostsUnknown
my $FirstTime=0;
my $LastTime=0;
- $TotalUnique=$TotalVisits=$TotalPages=$TotalHits=$TotalBytes=$TotalHostsKnown=$TotalHostsUnknown=0;
+ $TotalUnique=$TotalVisits=$TotalPages=$TotalHits=$TotalBytes=0;
+ $TotalNotViewedPages=$TotalNotViewedHits=$TotalNotViewedBytes=0;
+ $TotalHostsKnown=$TotalHostsUnknown=0;
my $beginmonth=$MonthRequired;my $endmonth=$MonthRequired;
if ($MonthRequired eq 'all') { $beginmonth=1;$endmonth=12; }
for (my $month=$beginmonth; $month<=$endmonth; $month++) {
my $monthix=sprintf("%02s",$month);
if ($FirstTime{$YearRequired.$monthix} && ($FirstTime == 0 || $FirstTime > $FirstTime{$YearRequired.$monthix})) { $FirstTime = $FirstTime{$YearRequired.$monthix}; }
if ($LastTime < ($LastTime{$YearRequired.$monthix}||0)) { $LastTime = $LastTime{$YearRequired.$monthix}; }
+ $TotalHostsKnown+=$MonthHostsKnown{$YearRequired.$monthix}||0; # Wrong in year view
+ $TotalHostsUnknown+=$MonthHostsUnknown{$YearRequired.$monthix}||0; # Wrong in year view
+ $TotalUnique+=$MonthUnique{$YearRequired.$monthix}||0; # Wrong in year view
$TotalVisits+=$MonthVisits{$YearRequired.$monthix}||0;
$TotalPages+=$MonthPages{$YearRequired.$monthix}||0;
$TotalHits+=$MonthHits{$YearRequired.$monthix}||0;
$TotalBytes+=$MonthBytes{$YearRequired.$monthix}||0;
- $TotalUnique+=$MonthUnique{$YearRequired.$monthix}||0; # Wrong in year view
- $TotalHostsKnown+=$MonthHostsKnown{$YearRequired.$monthix}||0; # Wrong in year view
- $TotalHostsUnknown+=$MonthHostsUnknown{$YearRequired.$monthix}||0; # Wrong in year view
+ $TotalNotViewedPages+=$MonthNotViewedPages{$YearRequired.$monthix}||0;
+ $TotalNotViewedHits+=$MonthNotViewedHits{$YearRequired.$monthix}||0;
+ $TotalNotViewedBytes+=$MonthNotViewedBytes{$YearRequired.$monthix}||0;
}
# TotalHitsErrors TotalBytesErrors
my $TotalHitsErrors=0; my $TotalBytesErrors=0;
#---------------------------------------------------------------------
if ($ShowMonthStats) {
if ($Debug) { debug("ShowMonthStats",2); }
- print "$Center<a name=\"month\"> </a><br />\n";
my $title="$Message[128]";
&tab_head("$title",0,0,'month');
if ($TotalVisits > 0) { $RatioHits=int($TotalHits/$TotalVisits*100)/100; }
if ($TotalVisits > 0) { $RatioBytes=int(($TotalBytes/1024)*100/($LogType eq 'M'?$TotalHits:$TotalVisits))/100; }
- print "<tr bgcolor=\"#$color_TableBGRowTitle\"><td><b>$Message[8]</b></td>\n";
+ my $colspan=5;
+ my $w='20';
+ if ($LogType eq 'W') { $w='17'; $colspan=6; }
+
+ print "<tr bgcolor=\"#$color_TableBGRowTitle\">";
+ if ($LogType eq 'W') { print "<td> </td>"; }
+ print "<td><b>$Message[8]</b></td>\n";
print "<td colspan=\"3\">$Message[128]</td>";
print "<td><b>$Message[9]</b></td></tr>\n";
- if ($FirstTime) { print "<tr bgcolor=\"#$color_TableBGRowTitle\"><td>".Format_Date($FirstTime,0)."</td>"; }
- else { print "<tr bgcolor=\"#$color_TableBGRowTitle\"><td>NA</td>"; }
+ print "<tr bgcolor=\"#$color_TableBGRowTitle\">";
+ if ($LogType eq 'W') { print "<td> </td>"; }
+ if ($FirstTime) { print "<td>".Format_Date($FirstTime,0)."</td>"; }
+ else { print "<td>NA</td>"; }
print "<td colspan=\"3\"><b>";
print ($MonthRequired eq 'all'?"$Message[6] $YearRequired":"$Message[5] ".$MonthNumLib{$MonthRequired}." $YearRequired");
print "</b></td>";
else { print "<td>NA</td></tr>\n"; }
# Show main indicators
print "<tr>";
- if ($ShowMonthStats =~ /U/i) { print "<td width=\"20%\" bgcolor=\"#$color_u\"".($TOOLTIPON?" onmouseover=\"ShowTip(2);\" onmouseout=\"HideTip(2);\"":"").">$Message[11]</td>"; } else { print "<td width=\"20%\"> </td>"; }
- if ($ShowMonthStats =~ /V/i) { print "<td width=\"20%\" bgcolor=\"#$color_v\"".($TOOLTIPON?" onmouseover=\"ShowTip(1);\" onmouseout=\"HideTip(1);\"":"").">$Message[10]</td>"; } else { print "<td width=\"20%\"> </td>"; }
- if ($ShowMonthStats =~ /P/i) { print "<td width=\"20%\" bgcolor=\"#$color_p\"".($TOOLTIPON?" onmouseover=\"ShowTip(3);\" onmouseout=\"HideTip(3);\"":"").">$Message[56]</td>"; } else { print "<td width=\"20%\"> </td>"; }
- if ($ShowMonthStats =~ /H/i) { print "<td width=\"20%\" bgcolor=\"#$color_h\"".($TOOLTIPON?" onmouseover=\"ShowTip(4);\" onmouseout=\"HideTip(4);\"":"").">$Message[57]</td>"; } else { print "<td width=\"20%\"> </td>"; }
- if ($ShowMonthStats =~ /B/i) { print "<td width=\"20%\" bgcolor=\"#$color_k\"".($TOOLTIPON?" onmouseover=\"ShowTip(5);\" onmouseout=\"HideTip(5);\"":"").">$Message[75]</td>"; } else { print "<td width=\"20%\"> </td>"; }
+ if ($LogType eq 'W') { print "<td bgcolor=\"#$color_TableBGRowTitle\"> </td>"; }
+ if ($ShowMonthStats =~ /U/i) { print "<td width=\"$w%\" bgcolor=\"#$color_u\"".($TOOLTIPON?" onmouseover=\"ShowTip(2);\" onmouseout=\"HideTip(2);\"":"").">$Message[11]</td>"; } else { print "<td width=\"20%\"> </td>"; }
+ if ($ShowMonthStats =~ /V/i) { print "<td width=\"$w%\" bgcolor=\"#$color_v\"".($TOOLTIPON?" onmouseover=\"ShowTip(1);\" onmouseout=\"HideTip(1);\"":"").">$Message[10]</td>"; } else { print "<td width=\"20%\"> </td>"; }
+ if ($ShowMonthStats =~ /P/i) { print "<td width=\"$w%\" bgcolor=\"#$color_p\"".($TOOLTIPON?" onmouseover=\"ShowTip(3);\" onmouseout=\"HideTip(3);\"":"").">$Message[56]</td>"; } else { print "<td width=\"20%\"> </td>"; }
+ if ($ShowMonthStats =~ /H/i) { print "<td width=\"$w%\" bgcolor=\"#$color_h\"".($TOOLTIPON?" onmouseover=\"ShowTip(4);\" onmouseout=\"HideTip(4);\"":"").">$Message[57]</td>"; } else { print "<td width=\"20%\"> </td>"; }
+ if ($ShowMonthStats =~ /B/i) { print "<td width=\"$w%\" bgcolor=\"#$color_k\"".($TOOLTIPON?" onmouseover=\"ShowTip(5);\" onmouseout=\"HideTip(5);\"":"").">$Message[75]</td>"; } else { print "<td width=\"20%\"> </td>"; }
print "</tr>\n";
print "<tr>";
+ if ($LogType eq 'W') { $w='17'; print "<td class=\"aws\">$Message[160] *</td>"; }
if ($ShowMonthStats =~ /U/i) { print "<td>".($MonthRequired eq 'all'?"<b><= $TotalUnique</b><br />$Message[129]":"<b>$TotalUnique</b><br /> ")."</td>"; } else { print "<td> </td>"; }
if ($ShowMonthStats =~ /V/i) { print "<td><b>$TotalVisits</b><br />($RatioVisits $Message[52])</td>"; } else { print "<td> </td>"; }
if ($ShowMonthStats =~ /P/i) { print "<td><b>$TotalPages</b><br />($RatioPages ".lc($Message[56]."/".$Message[12]).")</td>"; } else { print "<td> </td>"; }
if ($ShowMonthStats =~ /H/i) { print "<td><b>$TotalHits</b>".($LogType eq 'M'?"":"<br />($RatioHits ".lc($Message[57]."/".$Message[12]).")</td>"); } else { print "<td> </td>"; }
if ($ShowMonthStats =~ /B/i) { print "<td><b>".Format_Bytes(int($TotalBytes))."</b><br />($RatioBytes $Message[108]/".lc($Message[($LogType eq 'M'?149:12)]).")</td>"; } else { print "<td> </td>"; }
print "</tr>\n";
+ print "<tr>";
+ if ($LogType eq 'W') {
+ print "<td class=\"aws\">$Message[161] *</td>";
+ print "<td colspan=2> <br> </td>\n";
+ if ($ShowMonthStats =~ /P/i) { print "<td><b>$TotalNotViewedPages</b></td>"; } else { print "<td> </td>"; }
+ if ($ShowMonthStats =~ /H/i) { print "<td><b>$TotalNotViewedHits</b></td>"; } else { print "<td> </td>"; }
+ if ($ShowMonthStats =~ /B/i) { print "<td><b>".Format_Bytes(int($TotalNotViewedBytes))."</b></td>"; } else { print "<td> </td>"; }
+ }
+ print "</tr>\n";
+ &tab_end($LogType eq 'W'?"* $Message[159]":"");
- my $colspan=5;
- print "<tr valign=\"bottom\"><td align=\"center\" colspan=\"$colspan\">";
+ # BY MONTH
+ #---------------------------------------------------------------------
+ if ($ShowMonthStats) {
+
+ if ($Debug) { debug("ShowMonthStats",2); }
+ print "$Center<a name=\"month\"> </a><br />\n";
+ my $title="$Message[162]";
+ &tab_head("$title",0,0,'month');
+ print "<tr><td align=\"center\">\n";
+ print "<center>\n";
$average_nb=$average_u=$average_v=$average_p=$average_h=$average_k=0;
$total_u=$total_v=$total_p=$total_h=$total_k=0;
- print "<center>\n";
$max_v=$max_p=$max_h=$max_k=1;
# Define total and max
print "</td></tr>\n";
&tab_end;
}
+ }
print "\n<a name=\"WHEN\"> </a>\n\n";
# So it's new line approved
# If other month/year, create/update tmp file and purge data arrays with
# &Read_History_With_TmpUpdate(lastprocessedyear,lastprocessedmonth,UPDATE,PURGE,"all",lastlinenumber,lastlineoffset,CheckSum($_));
+# Define a clean Url and Query (set urlwithnoquery, tokenquery and standalonequery and $field[$pos_url])
+# Define PageBool and extension
# Analyze: Misc tracker --> complete %misc
# Analyze: Add to favorites --> complete %_misc, next on loop
# Analyze: Worms --> complete %_worms, countedtraffic=1
# If (!countedtraffic) Analyze: Status code --> complete %_error_, %_sider404, %_referrer404 --> countedtraffic=1
# If (!countedtraffic) Analyze: Robots --> complete %_robot, countedtraffic=1
-# Define a clean Url and Query (set urlwithnoquery, tokenquery and standalonequery and $field[$pos_url])
-# Define PageBool and extension
# If (!countedtraffic) Analyze: File types - Compression
# If (!countedtraffic) Analyze: Date - Hour - Pages - Hits - Kilo
# If (!countedtraffic) Analyze: Login