date > 'date' (don't you want time? If yes, the fiel is 'time')
IP address > c-ip if you want the user IP addressotherwise it's 's-ip', but I assumed you know this one...
URL + Parameters > 'cs-uri-stem' and 'cs-uri-query'
3. Each website have an ID, this ID is used to name the logdirectory, so it's pretty easy to get the right logfiles by a script, parse the log file and get the wanted fields, and then insert into your database.
Hi fab777, I tell you what...... you are a legend mate, thanks so much for your help,
One last question, in my C:\inetpub\logs\LogFiles there are several log file example
W3SVC1 , W3SVC2 my question is how often these files are created and when we use the Log Parser does it query all the log files in C:\inetpub\logs\LogFiles
What I want to achive is to read all the required data from the log files and then insert them in the database, and then delete the log file.
Again many thanks for pointing me in the right direction.
I tell you what...... you are a legend mate, thanks so much for your help
Thanks thanks, but it was not so hard on this one... ;)
By default, the logfiles are daily "rotated", and you can identify them by name, logfiles are named with the date like for today 'ex120330.log'
I didn't understand rightly your need. If you don't want to keep the logfiles and just import the data in database, after importing the data from the old files, maybe the solution will be 'ODBC logging'.
swordfish8
11 Posts
IIS7 LogFiles
Mar 29, 2012 04:50 AM|LINK
Hi There,
I need some help in understanding IIS7 Log Files
1. I want to read date, IP address, URL + Parameters and insert them into database
2. What are the columns I should look for in the log files
3. There are several web sites running of IIS7 (web server) but I want to able to extract IIS Log Information for the selected sites only.
Any useful links/ code example will be greatly appreciated.
Many thanks for your help in advance.
Kind Regards
swordfish
fab777
922 Posts
Re: IIS7 LogFiles
Mar 29, 2012 08:02 AM|LINK
Hi,
1. you need these fields :
date > 'date' (don't you want time? If yes, the fiel is 'time')
IP address > c-ip if you want the user IP addressotherwise it's 's-ip', but I assumed you know this one...
URL + Parameters > 'cs-uri-stem' and 'cs-uri-query'
3. Each website have an ID, this ID is used to name the logdirectory, so it's pretty easy to get the right logfiles by a script, parse the log file and get the wanted fields, and then insert into your database.
Maybe LogParser will be usefull for your need :
> [url=http://www.iis.net/community/default.aspx?tabid=34&g=6&i=1976]http://www.iis.net/community/default.aspx?tabid=34&g=6&i=1976[/url]
> [url=http://blogs.iis.net/carlosag/archive/2010/03/25/analyze-your-iis-log-files-favorite-log-parser-queries.aspx]http://blogs.iis.net/carlosag/archive/2010/03/25/analyze-your-iis-log-files-favorite-log-parser-queries.aspx[/url]
Please 'Mark as Answer' if this post helps you.
Fabrice ZERROUKI
swordfish8
11 Posts
Re: IIS7 LogFiles
Mar 29, 2012 07:38 PM|LINK
Hi fab777, I tell you what...... you are a legend mate, thanks so much for your help,
One last question, in my C:\inetpub\logs\LogFiles there are several log file example W3SVC1 , W3SVC2 my question is how often these files are created and when we use the Log Parser does it query all the log files in C:\inetpub\logs\LogFiles
What I want to achive is to read all the required data from the log files and then insert them in the database, and then delete the log file.
Again many thanks for pointing me in the right direction.
Kind Regards
fab777
922 Posts
Re: IIS7 LogFiles
Mar 30, 2012 07:56 AM|LINK
By default, the logfiles are daily "rotated", and you can identify them by name, logfiles are named with the date like for today 'ex120330.log'
I didn't understand rightly your need. If you don't want to keep the logfiles and just import the data in database, after importing the data from the old files, maybe the solution will be 'ODBC logging'.
Here's some reading about his:
> [url=http://www.iis.net/ConfigReference/system.webServer/odbcLogging]http://www.iis.net/ConfigReference/system.webServer/odbcLogging[/url]
> [url=http://blogs.iis.net/rakkimk/archive/2008/04/16/how-to-configure-iis-7-0-for-odbc-logging.aspx]http://blogs.iis.net/rakkimk/archive/2008/04/16/how-to-configure-iis-7-0-for-odbc-logging.aspx[/url]
Please 'Mark as Answer' if this post helps you.
Fabrice ZERROUKI