通过在Windows事件查看器中手动编辑XML过滤器查询,我可以找到数据与字符串完全匹配的事件:
<QueryList>
<Query Id="0" Path="Application">
<Select Path="Application">*[EventData[Data and (Data="Session end: imzcjflrrsq1sfdk3okc4jpf")]]</Select>
</Query>
</QueryList>
现在,我要进行部分匹配:
<QueryList>
<Query Id="0" Path="Application">
<Select Path="Application">*[EventData[Data and (Data[starts-with(.,"Session")])]]</Select>
</Query>
</QueryList>
事件日志给我错误:
我的语法是否错误?
最佳答案
Windows事件日志支持XPath 1.0的子集。它仅包含3个函数:position
,Band
和timediff
。
引用:https://docs.microsoft.com/en-us/windows/desktop/WES/consuming-events#xpath-10-limitations