I want to filter the Windows eventlog to get just entries older the a specific timestamp. I'm searching fo a adequate filter query to pass to EvtQuery(...). I tried:
//Event[System/TimeCreated/@SystemTime >= '2023-12-12T12:00:00.0Z']
this filters the the expected entries when I test it with e.g.
https://www.freeformatter.com/xpath-tester.html, but it is not compatible with XPath1.0 for the EvtQuery(...) function. Next I copied the structured XML query example from
https://learn.microsoft.com/en-us/windows/win32/wes/consuming-eventsbut I get "ERROR_EVT_MALFORMED_XML_TEXT".
I simplified the query to
<QueryList>
<Query Id="0">
<Select Path="Application">
*[System[(Level <= 3)]]
</Select>
/Query>
</QueryList>
but still the same error.
Where can I find information for the correct filter syntax?
Kind regards Thomas