EventLogReader.Seek Method

Definition

Changes the position in the event stream where the next event that is read will come from.

Overloads

Seek(EventBookmark)

Changes the position in the event stream where the next event that is read will come from by specifying a bookmark event. No events logged before the bookmark event will be retrieved.

Seek(EventBookmark, Int64)

Changes the position in the event stream where the next event that is read will come from by specifying a bookmark event and an offset number of events from the bookmark. No events logged before the bookmark plus the offset will be retrieved.

Seek(SeekOrigin, Int64)

Changes the position in the event stream where the next event that is read will come from by specifying a starting position and an offset from the starting position. No events logged before the starting position plus the offset will be retrieved.

Seek(EventBookmark)

Source:
EventLogReader.cs
Source:
EventLogReader.cs
Source:
EventLogReader.cs
Source:
EventLogReader.cs
Source:
EventLogReader.cs
Source:
EventLogReader.cs

Changes the position in the event stream where the next event that is read will come from by specifying a bookmark event. No events logged before the bookmark event will be retrieved.

C#
public void Seek(System.Diagnostics.Eventing.Reader.EventBookmark bookmark);

Parameters

bookmark
EventBookmark

The bookmark (placeholder) used as a starting position in the event log or stream of events. Only events that have been logged after the bookmark event will be returned by the query.

Remarks

You can use this function only on result sets from an Admin or Operational channel, or from .evtx log files. This function is not supported on analytic and debug channels, or for ETL files.

See also

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Seek(EventBookmark, Int64)

Source:
EventLogReader.cs
Source:
EventLogReader.cs
Source:
EventLogReader.cs
Source:
EventLogReader.cs
Source:
EventLogReader.cs
Source:
EventLogReader.cs

Changes the position in the event stream where the next event that is read will come from by specifying a bookmark event and an offset number of events from the bookmark. No events logged before the bookmark plus the offset will be retrieved.

C#
public void Seek(System.Diagnostics.Eventing.Reader.EventBookmark bookmark, long offset);
C#
[System.Security.SecurityCritical]
public void Seek(System.Diagnostics.Eventing.Reader.EventBookmark bookmark, long offset);

Parameters

bookmark
EventBookmark

The bookmark (placeholder) used as a starting position in the event log or stream of events. Only events that have been logged after the bookmark event will be returned by the query.

offset
Int64

The offset number of events to change the position of the bookmark.

Attributes

Remarks

You can use this function only on result sets from an Admin or Operational channel, or from .evtx log files. This function is not supported on analytic and debug channels, or for ETL files.

See also

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Seek(SeekOrigin, Int64)

Source:
EventLogReader.cs
Source:
EventLogReader.cs
Source:
EventLogReader.cs
Source:
EventLogReader.cs
Source:
EventLogReader.cs
Source:
EventLogReader.cs

Changes the position in the event stream where the next event that is read will come from by specifying a starting position and an offset from the starting position. No events logged before the starting position plus the offset will be retrieved.

C#
public void Seek(System.IO.SeekOrigin origin, long offset);
C#
[System.Security.SecurityCritical]
public void Seek(System.IO.SeekOrigin origin, long offset);

Parameters

origin
SeekOrigin

A value from the SeekOrigin enumeration defines where in the stream of events to start querying for events.

offset
Int64

The offset number of events to add to the origin.

Attributes

Remarks

You can use this function only on result sets from an Admin or Operational channel, or from .evtx log files. This function is not supported on analytic and debug channels, or for ETL files.

See also

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10