I am trying to read windows event logs for: "Microsoft-Windows-Sysmon/Operational" I tried:
string eventLogName = "Microsoft-Windows-Sysmon/Operational";
EventLog eventLog = new EventLog();
eventLog.Log = eventLogName;
foreach (EventLogEntry log in eventLog.Entries)
{
Console.WriteLine("{0}\n", log.Message);
}
However, I get:
System.InvalidOperationException: 'The event log 'Microsoft-Windows-Sysmon/Operational' on computer '.' does not exist.'*
I found a solution here It is using System.Diagnostics.Eventing.Reader namespace. However, I cannot seem to get this anywhere in my system or in the package manager.
Also, since many are claiming that the name of the log may be incorrect. Following is the screenshot of it:

Are you sure you are using the correct naming semantics. This is the error you get if a log source has been created with that name on that machine. As alternative you can
use System.Managementand query directly.Below is a function I have used in the past...NOTE :
ServerLogEntryis an object from my application domain.Here is the native structure returned -->