xml - EventLog XML查询过滤器日期范围

标签 xml windows event-log

似乎找不到正确的语法来查询特定日期范围之间的事件日志

<QueryList>
  <Query Id="0" Path="Security">
        <Select Path="Security"> 
        *[EventData[Data[@Name='SubjectUserName'] and (Data='test')]] 
        and
        *[System[TimeCreated[@SystemTime'] &gt;= '2015-01-24T00:00:000Z']]
        and
        *[System[TimeCreated[@SystemTime'] &lt;= '2015-01-26T00:00:000Z']]
    </Select>
  </Query>
</QueryList>

最佳答案

该语法错误:[System[TimeCreated[@SystemTime] &gt;= ...必须是[System[TimeCreated[@SystemTime&gt;= ...
请在下面查看我的更正

<QueryList>
  <Query Id="0" Path="System">
    <Select Path="System">
    *[System[TimeCreated[@SystemTime&gt;='2017-12-28T00:00:00' and @SystemTime&lt;='2018-01-04T00:00:00']]]
    </Select>
  </Query>
</QueryList>

关于xml - EventLog XML查询过滤器日期范围,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28175718/

相关文章:

xml - 消除xml文件的声明

java - jaxb - 具有完整 java 包的编码根元素

windows - Wix:使用用户指定的服务名称安装 Windows 服务

c# - 无法并行读取同一个文件

c# - Startup.cs 中的 Global.asax Application_Error 等效项

sql-server - SQL Server 服务无法启动

java - 如何修复此 "All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes)"

XML 到 YAML 转换

windows - CFFI 没有加载依赖库?

c# - 找不到参数引用 (%1) 的描述字符串