6

I am using sysmon to capture a bunch of event information (network connections, DLL loads, etc). I want to pull that information and use it for various purposes, but it doesn't seem like there is any way to retrieve the nested logs. They reside at

Event Viewer/Applications and Services/Microsoft/Windows/Sysmon/Operational

All of the code I've tried only pulls the "standard" Event Logs. For example:

EventLog[] eventLogs = EventLog.GetEventLogs();

has "Application", "Hardware Events", "Internet Explorer", etc.

I know how to create and retrieve custom event logs, but that doesn't seem to apply here, as these logs are not in the standard locations. Any help you can provide would be very much appreciated!

2
  • 1
    I would try looking at the System.Diagnostics.Eventing.Reader namespace. It has a much richer API for getting event logs. EventLogSession.GetLogNames returns much larger list than EventLog.GetEventLogs. Commented Apr 19, 2015 at 2:53
  • ^^ This is EXACTLY what I was looking for. Thank you so much :) If you answer I'll mark it. Commented Apr 19, 2015 at 14:48

1 Answer 1

6

Take a look at the System.Diagnostics.Eventing.Reader namespace. In particular, you can get a complete list of log names from:

EventLogSession.GlobalSession.GetLogNames()

This has a much more complete list than EventLog.GetEventLogs(). Other useful classes in this namespace are EventLogReader and EventLogWatcher.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.