title: How to filter out events that contain a specific string while reading event viewer logs?
body: <p>I am working on reading event viewer records in C# and I want to filter the events based on some substring I get in details,</p>
  <p>For eg - I want to filter out events in Application log with eventid 1000 for some specific application name.</p>
  <p>How can I can create a query checking for a particular string in details ?</p>
  <pre><code>string xpathQuery = &quot;Event/System[EventID = 1000 and //Here need to add check for containing string in details]&quot;;
  
  var eventLogQuery = new EventLogQuery(filter.ChannelName, PathType.LogName, xpathQuery);
  var eventLogReader = new EventLogReader(eventLogQuery);
  
  EventRecord eventRecord = eventLogReader.ReadEvent();
  // Procced 
  </code></pre>