【问题标题】:WEC : How to uniquely identify logs in `Forwarded Events` channelWEC:如何唯一标识“转发事件”通道中的日志
【发布时间】:2020-08-14 07:14:38
【问题描述】:

在使用 Windows 事件收集器时,寻找更多信息或至少有关替代 EventRecordID 作为索引的建议。
在使用单个服务器和单个 Eventlog 时,EventRecordID 元素可用作索引,以便在按顺序爬取事件时保留您的位置。
但是,在使用 Windows 事件收集器时,事件会在 ForwardedEvents 日志中保留其原始 EventRecordID。这使得在使用脚本/程序爬取事件时很难跟踪您所在的位置。
日期/时间戳也无济于事,因为在您超过给定日期/时间后,事件可能会从其他系统进入。

是否有人对在 ForwardedEvents 中跟踪、添加书签或索引事件的方式有任何建议?

【问题讨论】:

    标签: windows event-log


    【解决方案1】:

    您可以使用 BookmarkID

    See how to get it with the Microsoft example in C++ here

    或者像我对 C# 所做的那样

    EventLogQuery eventsQuery = new EventLogQuery("ForwardedEvents", PathType.LogName);
    EventLogReader logReader = new EventLogReader(eventsQuery);
    EventRecord myevent = logReader.ReadEvent();
    string bookmark = ReflectionHelper.GetPropertyValue(myevent.Bookmark, "BookmarkText").ToString();
    

    ReflectionHelper is not from me. Source here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-25
      • 1970-01-01
      • 1970-01-01
      • 2017-02-21
      • 1970-01-01
      • 1970-01-01
      • 2020-04-19
      • 1970-01-01
      相关资源
      最近更新 更多