We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

DateTimeRSS

6 replies

Last post Jun 30, 2004 12:35 PM by Anonymous

  • DateTime

    Jun 04, 2004 01:03 PM|Anonymous|LINK

    Hi,

    Now that I'm able to successfully parse my log file, I'm trying to pull records for a specific time interval. Something like the following.

    Logparser -i:NCSA "SELECT * FROM test.log WHERE DateTime > TO_TIMESTAMP('05/21/04','mm/dd/yy')"

    ERROR: Syntax Error: <content>: no valid content (missing opening parenthesys)

    What should my syntax be?

    -Brett

    NCSA input format

  • Re: DateTime

    Jun 07, 2004 10:59 AM|Anonymous|LINK

    You're using 2.0, correct?

    2.0 did not support anything other than constants on the right-side of operators.

    ------------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm

     

    NCSA input format

  • Re: DateTime

    Jun 07, 2004 01:50 PM|Anonymous|LINK

    Yes I'm using 2.0. Is 2.1 available without having to download the IIS 6.0 resource kit? Or a preview of 2.2?

     

    -Brett

    NCSA input format

  • Re: DateTime

    Jun 08, 2004 10:28 AM|Anonymous|LINK

    The only way to get 2.1 is to download the whole IIS6 Resource Kit. However, once you have downloaded the Resource Kit installer, you can choose to install Log Parser only.

    ------------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm

    NCSA input format

  • Re: DateTime

    Jun 28, 2004 03:41 PM|Anonymous|LINK

    Hi,

    Back again Ok I have gotten logparser 2.1 installed and am still having issues selecting by a date/time. I've been trying the following:

    D:\>logparser -i:ncsa "SELECT * FROM c:\citys_access_052104.txt WHERE DateTime > TO_TIMESTAMP('09:30:00', hh:mm:ss')"

    This is returning all rows, not just those from 9:30am.

     

    -Brett

    NCSA input format

  • Re: DateTime

    Jun 30, 2004 07:33 AM|Anonymous|LINK

    That's because you're asking it the entries logged after 9:30 of January 1 year 0...

    You can either go for:

    WHERE TO_TIME(DateTime) > TO_TIMESTAMP('09:30:00', 'hh:mm:ss')

    OR

    WHERE DateTime > TO_TIMESTAMP('2004-06-29 09:30:00', 'yyyy-MM-dd hh:mm:ss')

    ------------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm

    NCSA input format

  • Re: DateTime

    Jun 30, 2004 12:35 PM|Anonymous|LINK

    Thanks Gabriele.

    I was trying to include the date in earlier permutations but couldn't get those to work. The source of the problems I was encountering earlier is the format mask for minutes and months. Although the help file does show the timestamp format for months as being M,MM,MMM, or MMMM I just missed it and used mm/dd/yy.

    NCSA input format