SymptomsWebalizer statistics are missing for a certain period, and running statistics.exe does not help.
CauseThe root cause of the issue is unclear, although in some cases, it may occur due to log file corruption.
ResolutionMake sure that you have already tried to recalculate statistics by running the statistics.exe utility as described in this article:
1998 [FIX] Web statistics on the server do not get updated
If you are unable to recalculate the statistics with this command and have some time to investigate the problem, feel free to use the available support options in our Support portal (located in the menu on the left).
WorkaroundIf you urgently need to solve the issue, you may use the below workaround.
First, make sure that the log files for the needed period exist in %plesk_vhosts%\domain.tld\statistics\logs\W3SVC12031 (the name of this folder may vary).
Then follow these steps to recalculate the statistics:
1) Create a temporary directory for logs that need to be processed:
2) Set the environment variable for this directory:
3) Back up previously calculated statistics:
xcopy /ie "C:\Inetpub\vhosts\domain.tld\statistics\webstat" "C:\Inetpub\vhosts\domain.tld\statistics\webstat.back"
4) Copy logs to the newly created directory.
ATTENTION: The log directory may contain very large log files, so copy only logs for the required period of time.
xcopy "%plesk_vhosts%\domain.tld\statistics\logs\W3SVC12031\*log" %logsdir%
5) Delete the webalizer.current file:
6) Change the directory to %logsdir%:
7) Convert logs from .log format to .ncsa with the convlog utility:
convlog -ie *log
8) Check if logs were converted successfully:
dir /b *ncsa
9) Replace the webalizer.hist file with another one to make Webalizer think that the needed logs have not been processed yet:
rename "C:\Inetpub\vhosts\domain.tld\statistics\webstat\webalizer.hist" webalizer.hist.old
findstr /v /b /c:"4 2012" "C:\Inetpub\vhosts\domain.tld\statistics\webstat\webalizer.hist.old" > "C:\Inetpub\vhosts\domain.tld\statistics\webstat\webalizer.hist"
Pay attention to the "4 2012" part -- this is the month and the year of the period you are getting statistics for. It will not be included in the new file in order to make Webalizer think that the statistics for this period have not been calculated.
10) Start the statistics calculation:
for /f %f in ('dir /b *ncsa') do @"%plesk_dir%\Additional\Webalizer\bin\webalizer" -c "%plesk_dir%\Additional\Webalizer\conf\webalizer.conf" -n "domain.tld" -D "%plesk_dir%\tmp\webalizer.cache" -N 15 -p -F clf -o "C:\Inetpub\vhosts\domain.tld\statistics\webstat" %logsdir%\%f