Previous Next

Thread: Exchange 2003 logs Cannot use Distinct on MSGID field?

Last post 05-15-2008 7:12 AM by Zhao Ji Ma - MSFT. 4 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (5 items)

Sort Posts:

  • 05-08-2008, 2:48 PM

    • yanaho
    • Not Ranked
    • Joined on 05-08-2008, 6:39 PM
    • Posts 6
    • yanaho

    Exchange 2003 logs Cannot use Distinct on MSGID field?

    Hi there, I am trying to figure out why this doesn't work.  I would like to use distinct on the MSGID field in the exchange logs but it doesn't work

     

    LogParser "SELECT DISTINCT MSGID,Event-ID, Time, Recipient-Address, Sender-Address, Message-Subject FROM test.log WHERE Event-ID = '1028' OR Event-ID = '1020'" -i:W3c -separator:tab -dtlines:20 -o:datagrid

     

    Any help would be appreciated.

    Thanks

  • 05-13-2008, 2:16 AM In reply to

    Re: Exchange 2003 logs Cannot use Distinct on MSGID field?

    Hi yanaho,

    When you use distinct keyword with more than one column, select clause returns unique result of  the combination of multiple columns in the query.

    Zhao Ji Ma
    Sincerely,
    Microsoft Online Community Support

    “Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
  • 05-13-2008, 8:51 AM In reply to

    • yanaho
    • Not Ranked
    • Joined on 05-08-2008, 6:39 PM
    • Posts 6
    • yanaho

    Re: Exchange 2003 logs Cannot use Distinct on MSGID field?

    So I'm a little confused as I only wanted distinct on the MSGID field, is my query incorrect?

  • 05-15-2008, 5:37 AM In reply to

    • qbernard
    • Top 10 Contributor
    • Joined on 03-26-2003, 2:12 AM
    • Malaysia
    • Posts 2,180
    • IIS MVPs
    • qbernard

    Re: Exchange 2003 logs Cannot use Distinct on MSGID field?

    so without distinct work? what's the error msgs? or was it not distinct records were selected.

    Cheers,
    Bernard Cheah
  • 05-15-2008, 7:12 AM In reply to

    Re: Exchange 2003 logs Cannot use Distinct on MSGID field?

    OK, besides have you tried two of the following query. The first query is a single MSGID column.

    (1) 

    LogParser "SELECT DISTINCT MSGID FROM test.log WHERE Event-ID = '1028' OR Event-ID = '1020'" -i:W3c -separator:tab -dtlines:20 -o:datagrid

    (2) 

    LogParser "SELECT DISTINCT MSGID,Event-ID, Time, Recipient-Address, Sender-Address, Message-Subject FROM test.log WHERE Event-ID = '1028' OR Event-ID = '1020'" -i:W3c -separator:tab -dtlines:20 -o:datagrid

     

    Zhao Ji Ma
    Sincerely,
    Microsoft Online Community Support

    “Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
Page 1 of 1 (5 items)
Page view counter