I have the following code:
string query = "???";
EventLogQuery elq = new EventLogQuery("Application", PathType.LogName, query);
elq.Session = new EventLogSession("x.x.x.x");
EventLogReader elr = new EventLogReader(elq);
I'm trying to figure out what I need to set query to in order to look for all entries with a source of "SQLSERVERAGENT".
I have just spent an hour trying to solve similar for myself and thought I would contribute back with the solution for anyone else that comes this way. The comments should be fairly self explanatory.