Previous Next

Thread: Reformatting IIS log files without the "#..." lines

Last post 06-24-2008 11:55 PM by Jannisson. 7 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (8 items)

Sort Posts:

  • 06-11-2008, 8:27 PM

    • Jannisson
    • Not Ranked
    • Joined on 06-11-2008, 8:16 PM
    • Posts 4
    • Jannisson

    Reformatting IIS log files without the "#..." lines

    I need to import our IIS logs into SQL.  I have found all sorts of articles that describe how to do this, but none of them (that I've found anyway) describe how to actually reformat the log files so that all lines beginning with a "#" are taken out.  That's all I need to get accomplished at this point.  I know how to import them once they are reformatted, but getting them reformatted has been the bane of my existence so far.

     Can Log Parser be used to do this?  I don't want to write, "pre" queries if you will, against the log file before hand.  I just want to open the file, delete those lines, and save it into a new filename.

    If this is possible, can somone please provide me with syntax as well.  Think of this as explaining to a 3 year old.  :)

    Thanks in advance.

    - Jann

  • 06-11-2008, 9:51 PM In reply to

    Re: Reformatting IIS log files without the "#..." lines

    Log parser could be used to create a CSV file or used to insert directly into sql server, it depends on how you want to do it. 

    I'd just look at the examples they are pretty good.

    logparser -h examples > help.txt 

    This will pipe the examples to a text file you can review.

    Steve Schofield
    Windows Server MVP - IIS
    MCTS - Windows Hosting

    http://weblogs.asp.net/steveschofield
    http://www.iislogs.com
    http://www.orcsweb.com/
    Managed Hosting Solutions
    #1 in Service and Support
  • 06-12-2008, 8:24 AM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 10:27 AM
    • Lawrenceville, NJ
    • Posts 3,538
    • IIS MVPs
    • tomkmvp

    Re: Reformatting IIS log files without the "#..." lines

    I think logparser is the ticket - it will ignore the # lines completely and write the data directly into your database.

  • 06-12-2008, 8:41 PM In reply to

    • Jannisson
    • Not Ranked
    • Joined on 06-11-2008, 8:16 PM
    • Posts 4
    • Jannisson

    Re: Reformatting IIS log files without the "#..." lines

    Thanks guys.  I figured out the syntax in logparser.  And you're right, it just ignored the "#" lines all together.  Didn't need to reformat the logs.

    Thanks,

    Jann

  • 06-24-2008, 11:58 AM In reply to

    • pcwatch
    • Not Ranked
    • Joined on 06-20-2008, 3:28 PM
    • Posts 4
    • pcwatch

    Re: Reformatting IIS log files without the "#..." lines

    There is also a tool called preplog that removes the # lines, it can be downloaded from: http://support.microsoft.com/kb/296093

  • 06-24-2008, 3:40 PM In reply to

    • Jannisson
    • Not Ranked
    • Joined on 06-11-2008, 8:16 PM
    • Posts 4
    • Jannisson

    Re: Reformatting IIS log files without the "#..." lines

    Preplog was actually the first thing I tried when I was first tasked with this project, but for some reason, every time I tried using it, it would truncate the log file.  It wouldn't have the pound signs anymore, but in some cases, 75% or more of the log was lost.

    It could have been some setting I had wrong though, who knows.  Thanks for the tip anyway.

    -Jann

  • 06-24-2008, 11:33 PM In reply to

    Re: Reformatting IIS log files without the "#..." lines

    Thanks for posting info on preplog.  I've never heard of it until this post, it shows IIS 3,4,5.  I don't think logging has changed, but log parser will handle this.

    Steve Schofield
    Windows Server MVP - IIS
    MCTS - Windows Hosting

    http://weblogs.asp.net/steveschofield
    http://www.iislogs.com
    http://www.orcsweb.com/
    Managed Hosting Solutions
    #1 in Service and Support
  • 06-24-2008, 11:55 PM In reply to

    • Jannisson
    • Not Ranked
    • Joined on 06-11-2008, 8:16 PM
    • Posts 4
    • Jannisson

    Re: Reformatting IIS log files without the "#..." lines

    Maybe that was my problem then if it only supports those versions.  We're using 6.  I guess I should've checked that eh?  :)

    But yes, Log Parser was the ticket.

    -Jann

Page 1 of 1 (8 items)
Page view counter