2

Hi Could you please let me know query to select top 10 pages from every iis log files using logparser.

Thanks,

rmdussa
  • 1,549
  • 10
  • 27
  • 50

2 Answers2

4

Get all the logs into a directory then run

logparser "SELECT cs-uri-stem, COUNT(*) as cnt FROM *.log GROUP BY cs-uri-stem ORDER BY cnt DESC" -i:IISW3C -o:CSV

(This assumes the logs are in W3C format).

Mark Mascolino
  • 2,227
  • 1
  • 15
  • 19
0

Adding to Marks answer, here is how to limit the output to 10 records:

logparser "SELECT TOP 10 cs-uri-stem, COUNT(*) as cnt FROM *.log GROUP BY cs-uri-stem ORDER BY cnt DESC" -i:IISW3C -o:CSV

(This assumes the logs are in W3C format).

Timothy C. Quinn
  • 3,739
  • 1
  • 35
  • 47