Log parser is a good IIS log analysis tool that has been used for a long time. It mainly summarizes IIS logs and reports. However, it has never been used to completely import IIS logs to the database.
In the past two days, the company needs to perform a detailed analysis on the IIS logs (logs) of a site on a certain day, produce some detailed PV, IP address and many custom reports, and finally think about it, you can only import these logs to the database (SQL Server 2005. Since the PV of the site is about million this day, there are about IIS log records. Finally, I sorted out the following ideas and decided to use Log parser to import IIS logs to the database.
Open the help of log parser and find the corresponding operation in log parser-> reference-> output formats-> SQL-> examples, as shown below:
Logparser" Select Path, keyname, valulename Into Mytable From \ HKLM" - I: Reg - O: SQL - Server: myserver - Database : Mydatabase - Driver: "SQL Server" - Username: testsqluser - Password: testsqlpassword - Createtable: On
However, according to the help example, the import was not successful for nearly an hour. Finally, there was no way. Google found the correct command for half a day:
Logparser" Select * From D :\ 1 . Log To Iislog_table" - O: SQL - Server: 192.168 . 1.88 - Driver: "SQL Server" - Database : Test - Username: SA - Password: 111111 - Createtable: On
Then the import is started. Using logparser to import IIS log (IIS log) to SQL Server is very good and simple in general, that is, the speed is not very fast, you can only import about 1200 records in one second. Of course, this is also related to my computer configuration. We recommend that you exclude. jpg or pages ending with other formats before importing.