Gathering IIS Log files from a remote server
IISView is typically configured to process the web logs from IIS once a
day just before the rollover. It reads the logfiles produced by IIS for
all the days in the current month in the configured directory according
to the naming used by IIS. If you don't run the IIS server yourself,
you may not be able to install IISView on the web server or be able to
set it up to run as a scheduled task. It may instead be possible to
arrange for the files to be made available to the server running
IISView. e.g.
- Network share (to which you could run IISView directly, or copy
specific files)
- Web server
- FTP server
yesterday is provided in the
IISView distribution to identify the previous day's IIS log file e.g.
C:\>
date /t
Sun 15/06/2008
C:\>yesterday
ex080614.log
This can be incorporated into batch scripts run as scheduled tasks just
before IISView runs to get the current log file from the IIS server.
e.g.
Using FTP:
cd
\WINDOWS\system32\LogFiles\W3SVC1
yesterday > tmpFile
set /p yyy= < tmpFile
echo USER myusername mypassword
> tmpFile
echo cd logfiles\W3SVC1 >>
tmpFile
echo get %yyy% >> tmpFile
echo quit >> tmpFile
ftp -n -s:tmpFile myiisserver
del tmpFile
Using HTTP via wget:
cd
\WINDOWS\system32\LogFiles\W3SVC1
yesterday > tmpFile
set /p yyy= < tmpFile
del tmpFile
wget
http://www.myisp.com/logfiles/W3SVC39/%yyy%
Using a file share and copy
cd
\WINDOWS\system32\LogFiles\W3SVC1
yesterday > tmpFile
set /p yyy= < tmpFile
del tmpFile
xcopy
\\myiisserver\sharename\%yyy% .
If these commands are stored in get_log.bat, then to execute it
each evening before IISView runs :
at
23:50 /every:M,T,W,Th,F,S,Su "C:\Program Files\IISview\get_log.bat"
IISView - website traffic statistics from IIS log files.