Article ID: 115152, created on Nov 16, 2012, last review on Jul 26, 2016

  • Applies to:
  • Plesk for Windows


How to recalculate statistics using old IIS log files starting from a particular date?


Before following the steps below, it is recommended to gain understanding of the overall process of statistics calculation. When the statistics.exe utility is run, either manually or during daily maintenance, it performs the following actions to calculate statistics for each domain on the server:

  1. Parse IIS log files for the domain and only select non-processed records.

  2. Merge the selected records with the records from the default website log file.

  3. Process the resulting log file with the native statistics backend (AWStats or Webalizer).

The steps below describe how to properly recalculate statistics from a given date to the current date:

  1. Ensure Log Rotation is enabled and configured, and ensure that all fields for W3C logging are checked in IIS > Sites > > Logging.
  2. Verify the domain log files are not compressed and contain data:

    Use this command to find the log's location:

    "%plesk_bin%"\websrvmng.exe --get-vhost-log-dir

    Unzip and place all the log files you want to be processed by statistics into the above folder. Make sure they have the .log extension. It also may be a good idea to merge them all into a single .log file.

  3. Change the value of LastHttpStatisticsRun for the domain in the registry:

    Retrieve the domain ID from the psa database using this command:

    "%plesk_bin%"\dbclient.exe --direct-sql --sql="SELECT id, name FROM domains WHERE name=''"
    id      name

    Change the value of this registry key to the date from which statistics will be recalculated:

    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\PLESK\PSA Config\Config\Statistics\DomainIds\40\LastHttpStatisticsRun

    (where "40" is the domain ID obtained above from the psa database)

    If there is no LastHttpStatisticsRun in the registry, all available log files will be recalculated.

  4. If it is needed to recalculate statistics for a portion of the current month, edit this file (in this example, the current month is November 2012):


    Remove the lines starting with the following keywords from the file above:


    If it is needed to recalculate statistics for one or more months, delete the AWStats databases from the very first month for which the statistics needs to be recalculated. For example, to recalculate statistics for September 2012 (and it is now November 2012), delete the following files:


    If you accidentally forget this step, AWStats will ignore all log files as if they only contained old records.

  5. Remove the DNS cache file:

  6. Calculate statistics using this command:

    "%plesk_bin%"\statistics.exe --calculate-one

    In Plesk 11.0 and earlier, use the following command:

    "%plesk_bin%"\statistics.exe --verbose

    Alternatively, launch the Plesk Daily Maintenance scheduled task using the Windows Schedule tasks snap-in.

  7. If the last step did not cause your statistics to be updated, execute the below command:

    "%plesk_bin%"\statistics.exe --generate-domain-webstat

    In Plesk 11.0 and earlier, use the following command:

    "%plesk_dir%"\admin\bin\web_statistics_executor.exe --calculate-domain
  8. For cases when u_extend**.log contains full statistics information, but web***.log does not:

    • check particular date when statistics stopped being updated in web***.log file.
    • locate the same date in u_extend**.log file and analyze it's content.
    • if there are some not well formatted lines, edit them so that they look like others, for example:

              #Software: Microsoft Internet Information Services 8.0
      #Version: 1.0
      #Date: 2015-05-22 00:28:14

      The first line is wrongly configured. It should be:

      #Software: Microsoft Internet Information Services 8.0
      #Version: 1.0
      #Date: 2015-05-22 00:28:14

Additional Information

If the statistics are incorrect, try the instructions in the following article, which should help you avoid such issues in the future:

#3606 - [Info] Statistics are calculated incorrectly: "Bad allocation" error

Search Words

webstats not work

statistics not getting calculated

website statistics full list get 404

statistics problem

awstats not updating

difference between hits and visits web statistics

You do not have permission to view this directory or page.

webstats not updating

Statistics not updating

rebuild awstats configuration file

cannot update awstats plesk windows


statistics geoip

web statistics

statistics won't generate

Statistic no longer being gathered

Statistics not updated

webstat not working


current webstats are not showing

web-stat is not working for all domain

AWstats statistics data for previous year is erased on year change.

country information not shown in stats plesk windows

statistics missing or incomplete

problem about statistics

web stats not updating

Missing stats

Web Statistics

Actual hits not reflecting in Statistics

not able to view the actual webstats

This is the placeholder for Web statistics. If you see this page that means that statistics service has not run yet on your server. Statistics service is typically set to run once every 24 hours. If you do not see a change to this page in the next 24 hours contact your server administrator for assistance.

statistics issues

The data has not been collected yet.

Webstats not getting updated

This version of AWStats is not compatible with very old history files

stats not working

stats not running

webstats not getting updated

56797cefb1efc9130f7c48a7d1db0f0c a914db3fdc7a53ddcfd1b2db8f5a1b9c 85a92ca67f2200d36506862eaa6ed6b8

Email subscription for changes to this article
Save as PDF