« Previous Next »

Thread: Custom field to IIS input

Last post 06-18-2007 3:03 AM by LogParser User : past777. 3 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (4 items)

Sort Posts:

  • 04-25-2007, 4:35 PM

    Custom field to IIS input

    Hello,

    I have been using a SELECT * statement before to put all the IIS log info into a SQL table and it works fine. I want to add 1 extra column to the SQL table though (a primary key). It wont let me use the select * statement anymore because the fields do not match. I even tried specifying the fields one by one but it will not work because there is a different amount of columns now.

    What I did was I modified the table already there with a new column (RecordID which is a auto-increment primary key). Can someone please give me advice on how I should persue this?  Keep the table with the new design and input the data differently, or somehow specify this new primary key column in the logparser statement.

    OLD COMMAND
    logparser.exe "SELECT * INTO tblIISLog_NEW FROM \\Hamweb001\LogFiles\W3SVC85298408\*.log" -o:SQL -server:hamdev005 -database:IISLOG_REPORTS -driver:"SQL Server" -createTableN -i:IISW3C -iCheckPoint:d:\checkpointweb.lpc>>checkpointweblog.txt

     

    NEW COMMAND I TRIED
    logparser.exe "SELECT LogFilename, LogRow, date, time, c-ip, cs-username, s-sitename, s-computername, s-ip, s-port, cs-method, cs-uri-stem, cs-uri-query, sc-status, sc-substatus, sc-win32-status, sc-bytes, cs-bytes, time-taken, cs-version, cs-host, cs(User-Agent), cs(Cookie), cs(Referer), s-event, s-process-type, s-user-time, s-kernel-time, s-page-faults, s-total-procs, s-active-procs, s-stopped-procs INTO tblIISLog_NEW FROM \\Hamweb001\LogFiles\W3SVC85298408\*.log" -o:SQL -server:hamdev005 -database:IISLOG_REPORTS -driver:"SQL Server" -createTableN -i:IISW3C -iCheckPoint:d:\checkpointweb.lpc>>checkpointweblog.txt

     

    Errors I get now:

    1) Number of columns in table 'tblIISLog_NEW' (33) is different than number of columns in SELECT clause (32)

    2) SQL table column "RecordID" data type is not compatible with SELECT clause item "LogFilename" (type STRING)

     

    Thank you

  • 04-27-2007, 9:45 AM In reply to

    RE: Custom field to IIS input

    I've been doing more reading but still cannot find if there is a way to do this. Is this possible?
  • 04-29-2007, 10:21 AM In reply to

    RE: Custom field to IIS input

    I don't think this is something you could easily do straight from LP. If you can't re-import the data, you probably need to look at using a different tool to update the table. As I just mentioned to someone else, an ETL tool like Kettle (http://kettle.pentaho.org) might help.
  • 06-18-2007, 3:03 AM In reply to

    RE: Custom field to IIS input

    in qwery-
    select 1 as id, ... from iisw3c_file

    and set id in your real sql table as int, identity - yes

    id's in your real sql table will be 1,2,3,4,5,6,...

     

     

Page 1 of 1 (4 items)
Microsoft Communities