Microsoft KB Archive/265848

= SS3: Analysis - How to Import Log Files and Generate Reports Using a Batch File =

Article ID: 265848

Article Last Modified on 6/28/2004

-

APPLIES TO


 * Microsoft Site Server 3.0 Standard Edition
 * Microsoft Site Server 3.0 Commerce Edition

-



This article was previously published under Q265848



SUMMARY
In Site Server 3.0, you can import log files and generate reports by using batch scripts with the help of Microsoft Windows NT Task Scheduler. This allows data to be imported to different databases, and it also automates the import process and eases administration efforts. The scripting method allows standard Usage Import, Custom Import, and even report generation.

WARNING: Editing the batch file while the scheduler is open can potentially put the scheduler and batch file out of synchronization. It is recommended that you schedule a Site Server Analysis task using the Graphical User Interface (GUI).



MORE INFORMATION
A simple batch file sample for Usage Import has the following syntax: REM START DO NOT MODIFY SET UIMPORT=&quot;E:\Microsoft Site Server\Bin\UImport.exe&quot; SET REPORT=&quot;E:\Microsoft Site Server\Bin\Report.exe&quot; SET CIMPORT=&quot;E:\Microsoft Site Server\Bin\CImport.exe&quot; REM REM END DO NOT MODIFY

REM START DO NOT MODIFY REM TASK &quot;Import Log File&quot; %UIMPORT% -silence messagelog=&quot;C:\Microsoft Site Server\Data\Analysis\Message\UImport.log&quot; db=&quot;sa:password@SQLserver_name/database_name&quot; source=&quot;chgIntranet2:K:\W3SVC4\ex$1.log&quot; REM REM END DO NOT MODIFY NOTE: If Usage Import uses a Microsoft SQL Server account other than the System Administrator account, you must change the username and password accordingly. It is important to note that Site Server Analysis cannot use trusted connections (Windows NT Authentication) for batch processing. A SQL Server Administrator username and password must be specified in the batch file for batch processing (scheduling task) to work. Lastly, the username that is used to connect to the Analysis database should have System Administrator privileges on the SQL server.

If the WHOIS query and other Import functions are performed together, the script must also include the following sections: REM START DO NOT MODIFY REM TASK &quot;Perform Whois Query&quot; %UIMPORT% -silence messagelog=&quot;Mymessage&quot; db=&quot;C:\Microsoft Site Server\Data\MsUsage.mdb&quot; action=&quot;WhoIs&quot; REM END DO NOT MODIFY

REM START DO NOT MODIFY REM TASK &quot;Perform HTML Title Lookup&quot; %UIMPORT% -silence messagelog=&quot;Mymessage&quot; db=&quot;C:\Microsoft Site Server\Data\MsUsage.mdb&quot; titles='(Title = &quot;&quot;)' REM END DO NOT MODIFY

REM START DO NOT MODIFY REM TASK &quot;Import Custom Data&quot; %CIMPORT% -silence messagelog=&quot;Mymessage&quot; db=&quot;C:\Microsoft Site Server\Data\MsUsage.mdb&quot; data=&quot;C:\Data.log&quot; siteId=&quot;1&quot; REM END DO NOT MODIFY

REM START DO NOT MODIFY REM TASK &quot;Import Content Data&quot; %CIMPORT% -silence messagelog=&quot;Mymessage&quot; db=&quot;C:\Microsoft Site Server\Data\MsUsage.mdb&quot; wmp=&quot;C:\web.wmp&quot; siteId=&quot;1&quot; REM END DO NOT MODIFY The results of the import can be viewed from the Import log folder, which is located at C:\Microsoft Site Server\Data\Analysis\Message\UImport.log.

Analysis Report scripts can be more complicated depending on the report needs and filter selections. Using GUI is recommended. The following is a sample script for updating dimensions: REM START DO NOT MODIFY REM TASK &quot;Update Dimension&quot; %CIMPORT% -silence messagelog=&quot;Mymessage&quot; db=&quot;C:\Microsoft Site Server\Data\MsUsage.mdb&quot; dimension=&quot;Version&quot; value=&quot;4.0&quot; where=&quot;(Os = &quot;Windows (32 bit)&quot;)&quot; REM END DO NOT MODIFY

REM START DO NOT MODIFY REM TASK &quot;Run Report&quot; %REPORT% -silence messagelog=&quot;Mymessage&quot; db=&quot;C:\Microsoft Site Server\Data\MsUsage.mdb&quot; report=&quot;C:\Microsoft Site Server\Bin\$1.htm&quot; reportdef=&quot;E:\Microsoft Site Server\Bin\Catalog \summary\executivesummary.mfa&quot; REM END DO NOT MODIFY