Pre-reqisites
Log Parser 2.2 : http://www.microsoft.com/en-gb/download/details.aspx?id=24659
Log parser studio : https://blogs.technet.com/b/exchange/archive/2012/03/07/introducing-log-parser-studio.aspx
Extract the software to
c:\program files\log parser studio
Monitoring steps
Open Log Parser Studio from
the installation directory (c:\program files\log parser studio\lps.exe)
Create a new query
Select the access logs
- Click on the choose log folder icon

- Click the select files button
- Select one or more access log files
- Select Open
- Select OK
Define the log file format
- On the bar between the results pane and the query pane, click
on the
icon next to the text Log
Type:NOTSET and select TSVLOG from the list - On the bar between the results pane and the query pane, click
on the
icon next to the text Log
Type:NOTSET and select - Set the headerRow value to False
- Set the iSeparator value to space

Query the log files
- In the query pane enter:
/*
Calculate the
following for each time:
Date summarised:
Date summarised:
breakdown
by day should be: substr(field7, 1, 11)
breakdown by hour should be: substr(field7,
1, 14)
Total time for all
requests
Total number of
requests
Average time of
requests
*/
SELECT
substr(field7, 1, 11) AS [date],
round(sum(field3)) AS [time],
count(field3) AS [count],
avg(field3) AS [avg]
/*
'[LOGFILEPATH]' represents
all the files selected
in the UI
*/
FROM
'[LOGFILEPATH]'
/*
Select only lines that
have a timestamp and do not contain
the text mr_pushlet
*/
where
field7 <> '+0000]'
AND field10 NOT LIKE '%mr_pushlet%'
/*
group by the datetime
field
breakdown by day should
be: group by substr(field7, 1, 11)
breakdown by hour
should be: group by substr(field7, 1, 14)
*/
group
by substr(field7, 1, 11)
Export the results
Create graphs

- Click and drag over a section of the graph to zoom in
- Save the chart by selecting Save Image from the file menu


No comments:
Post a Comment