Log parser imports IIS log (IIS log) to the database (SQL Server ).

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.