Export (0) Print
Expand All

StatusCodes.tpl used with StatusCodes.sql

Description

This template file creates an HTML document containing summary information about all the HTTP Status codes in the supplied log files (when used in conjunction with the StatusCodes.sql query file). To use this template file, type: "LogParser file:StatusCodes.sql -o:TPL -tpl:StatusCodes.tpl".

Requirements

You must install and use the Log Parser tool.

Supported Platforms

Windows Server 2003

Yes

Windows XP

No

Windows 2000

No


Template Code (save as StatusCodes.tpl)



<LPHEADER>
<HTML>
<HEAD><TITLE>Summary of HTTP Status 
Codes</TITLE></HEAD>
<BODY BGCOLOR="#EFEFFF">
<TABLE BORDER="1" CELLPADDING="2" 
CELLSPACING="2">
<TR>
<TH COLSPAN="2" ALIGN="CENTER">HTTP 
Status Summary</TH>
</TR>
<TR>
 <TH>HTTP Status Code</TH>
 <TH>Hit Count</TH>
</TR>
</LPHEADER>
<LPBODY>
<TR>
 <TD>%Status%</TD>
 <TD>%Total%</TD>
</TR>
</LPBODY>
<LPFOOTER>
</TABLE>
</BODY>
</HTML>
</LPFOOTER>



Query Code (save as StatusCodes.sql)



SELECT    STRCAT(TO_STRING(sc-status), REPLACE_IF_
NOT_NULL(TO_STRING(sc-substatus), STRCAT('.',TO_
STRING(sc-substatus)))) 
AS Status,
   COUNT(*) AS Total
FROM ex*.log
TO StatusCodes.html
GROUP BY Status
ORDER BY Status ASC



For any feedback regarding the content of these sample codes, please write to Microsoft TechNet. Please be aware that a response is not guaranteed.

Disclaimer


The sample scripts are not supported under any Microsoft standard support program or service. The sample scripts are provided AS IS without warranty of any kind. Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample scripts and documentation remains with you. In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample scripts or documentation, even if Microsoft has been advised of the possibility of such damages.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft