I know this question is very old, but today I spent a lot of time creating a solution for this, so I thought that I would share:
Dim myEventLogEntryCollection As EventLogEntryCollection = New EventLog("Application", System.Environment.MachineName).Entries Dim myEventLogEntryArray(myEventLogEntryCollection.Count - 1) As EventLogEntry myEventLogEntryCollection.CopyTo(myEventLogEntryArray, 0) Dim QueryLog As System.Linq.IQueryable(Of EventLogEntry) = myEventLogEntryArray.AsQueryable QueryLog = QueryLog.Where(Function(i As EventLogEntry) i.Source = "MyParticularSourceName") For Each Entry As EventLogEntry In QueryLog '... your code goes here Next myEventLogEntryCollection = Nothing myEventLogEntryArray = Nothing
Hope this helps others!
Rob
source share