Reputation: 6562
can't seem to find the right syntax to query the event log between a specific date range
<QueryList>
<Query Id="0" Path="Security">
<Select Path="Security">
*[EventData[Data[@Name='SubjectUserName'] and (Data='test')]]
and
*[System[TimeCreated[@SystemTime'] >= '2015-01-24T00:00:000Z']]
and
*[System[TimeCreated[@SystemTime'] <= '2015-01-26T00:00:000Z']]
</Select>
</Query>
</QueryList>
Upvotes: 2
Views: 9302
Reputation: 1
<QueryList>
<Query Id="0" Path="Security">
<Select Path="Security">
*[System[TimeCreated[@SystemTime>='2023-05-29T13:02:39.6038951Z
']]] and
*[System[TimeCreated[@SystemTime<='2023-05-29T13:15:03.7728533Z
']]]
</Select>
</Query>
</QueryList>
Upvotes: 0
Reputation: 11
This Syntax is wrong: [System[TimeCreated[@SystemTime] >= ...
It must be [System[TimeCreated[@SystemTime>= ...
See my correction below
<QueryList>
<Query Id="0" Path="System">
<Select Path="System">
*[System[TimeCreated[@SystemTime>='2017-12-28T00:00:00' and @SystemTime<='2018-01-04T00:00:00']]]
</Select>
</Query>
</QueryList>
Upvotes: 1
Reputation: 95
I see a extra apostrophe in your query I just removed that try this just in front of SystemTime .. It should run now.
`
<QueryList>
<Query Id="0" Path="Security">
<Select Path="Security">
*[EventData[Data[@Name='SubjectUserName'] and (Data='test')]]
and
*[System[TimeCreated[@SystemTime] >= '2015-01-24T00:00:000Z']]
and
*[System[TimeCreated[@SystemTime] <= '2015-01-26T00:00:000Z']]
</Select>
</Query>
</QueryList>'
Upvotes: 0