All things about Message Analyzer and related diagnosis for Networks, Log files, and Windows Components

Message Analyzer Forum is Live

Message Analyzer Forum is Live

  • Comments 3
  • Likes

We have created a public forum for discussing Message Analyzer related topics. Please go to the Microsoft Message Analyzer Forum to read more. Stay tuned for more information soon.

  • I'm having trouble with the DateTime format in my custom text log parser.

    I have a log file with text lines like this:

    2014-06-12T09:03:27-07:00 <30.7> sd-7-0-dev-606-1(id1) lsass[3075]: [lsass] VERBOSE:0x805b171e0:LsaSrvCacheFindObjects():lsass/server/api/memcache.c:2195: Using cache entry for sid S-1-5-21-1195855716-1269722693-1240286574-184919, updated 1 seconds ago with a cache id of 1.
    2014-06-12T09:03:27-07:00 <30.7> sd-7-0-dev-606-1(id1) lsass[3075]: [lsass-ipc] VERBOSE:0x805a02240:lwmsg_peer_assoc_session_handle_assoc_error():lwmsg/src/peer-assoc-session.c:599: (session:e8bf053cb31d67be-a6131aa94526a3d8) Dropping: LWMSG_STATUS_PEER_CLOSE
    2014-06-12T09:04:08-07:00 <30.5> sd-7-0-dev-606-1(id1) lsass[3075]: Log level changed to WARNING

    And a .config file with a message type like this:

    message LwisiLog with
    EntryInfo { Regex = @"(?[-\:0-9T]+) (?\<[\.0-9]+\>) (?[a-zA-Z0-9\-]+)\((?id[0-9]+)\) (?[a-z]+)\[(?[0-9]+)\]\: (?.*)"},
    DisplayInfo { ToText = LwisiLogToText }
    : LogEntry
    DateTime Timestamp with EntryFieldInfo { IsTimestamp = true, IsLocalTime = false };
    string Unknown1;
    string Hostname;
    string Unknown2;
    string Process;
    string PID;
    string Content;

    static string LwisiLogToText(any data)
    var e = data as LwisiLog;
    return e.Content;

    This loads and parses the log file fine, and the Timestamp shows up in the "Timestamp" column in the Analysis Grid. However, when I load up a pcap file taken at the same time, the traffic will not interleave with the log file rows. They only stack on top of each other.

    Furthermore, when I change the Shift Time on the log file rows nothing happens. The time in the "Timestamp" column do not appear modified. Changing the Shift Time on the pcap rows works fine.

    My best guess is this has something to do with the embedded timezone data in my log file ("-7:00").

    Any ideas?

  • So it looks like this is probably due to my use of "Timestamp" as a variable name.

    I copied the code from Cluster.config, which does the same thing:

    DateTime Timestamp with EntryFieldInfo {IsTimestamp = true, IsLocalTime = false };

    I've changed my variable name to "TStamp" and now both interleave and Shift Time work on my log file input.

  • Yes, since they have the same name, we use the field name over the property name, which is a string and will sort differently and not listen to time shifting. Glad you got your problem sorted out. And please feel free to use the forums for future questions.


Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment