Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parsing IIS Logs
Message
From
12/08/2003 02:30:54
Keith Payne
Technical Marketing Solutions
Florida, United States
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00819229
Message ID:
00819256
Views:
12
>I've done this a while back in Visual FoxPro where this is rather a trivial task because you can import the comma delimited data easily into a database.
>
>With .Net you're stuck reading hte data line by line and parsing the data as a string using Split. Not that difficult but reasonably easy to do as well. Once you have the data you can stick it into a database and summarize it fairly easily.

Not true Rick!

I recently stumbled upon an extremely useful function of the JET ODBC driver. You can open a CSV or fixed-field text file as a table by setting up a linked table in Access. Or you can create a schema.ini file in the same folder as the text file and skip the work in Access. My schema.ini for a fixed-field text file looks like this:
[Felony08032003.txt]
ColNameHeader=False
Format=FixedLength
MaxScanRows=0
CharacterSet=OEM
Col1="Defendant Number" Char Width 14
Col2="Last Name" Char Width 30
Col3="First Name" Char Width 15
Col4="Middle Name" Char Width 5
.
.
.
Col41="State Uniform Case Number" Char Width 20
If you poke around in google, you can find a more precise example for CSV.

My ODBC connection string for the file is:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" _
& Path.GetDirectoryName(SourceFileName) & ";Extended Properties='text'"
Charles,

There are a lot of IIS log parsers out there. Many of them are free. I can't point you to one off the top of my head, but I have seen many come up in google.

>
>With .Net you're stuck reading hte data line by line and parsing the data as a string using Split. Not that difficult but reasonably easy to do as well. Once you have the data you can stick it into a database and summarize it fairly easily.
>
>I've done some pretty useufl stuff with this like summarizing each page access and then allowing seeing the detail for each of the individual requests which is extremely useful in tracking attacks on your server and potentially blocking access.
>
>+++ Rick ---
>
>>Hi All,
>>
>>Currently, I track page hits, visits, referrers, etc by using a custom class created in VB.NET. I use the Request and Server objects to extract information per visit to my web application. It came to a point where I needed more information from each visit which led me to discovering the IIS logging feature of the IIS model. I'd like to know more info on this and if anyone out there can help point me to the right directions in researching this ability. Also, if someone out there has already created a parser for the IIS logs, it can really speed up my development. Thanks!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform