![Windows 事件过滤器使用自定义数据触发计划任务](https://linux22.com/image/757970/Windows%20%E4%BA%8B%E4%BB%B6%E8%BF%87%E6%BB%A4%E5%99%A8%E4%BD%BF%E7%94%A8%E8%87%AA%E5%AE%9A%E4%B9%89%E6%95%B0%E6%8D%AE%E8%A7%A6%E5%8F%91%E8%AE%A1%E5%88%92%E4%BB%BB%E5%8A%A1.png)
我需要创建一个自定义事件过滤器来触发计划任务来恢复挂起的进程。
以下是 XML 格式的事件日志:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="ASP.NET 4.0.30319.0" />
<EventID Qualifiers="32768">1309</EventID>
<Level>3</Level>
<Task>3</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2020-09-26T23:01:21.884208100Z" />
<EventRecordID>12229</EventRecordID>
<Channel>Application</Channel>
<Computer>Web-Srv2</Computer>
<Security />
</System>
<EventData>
<Data>3005</Data>
<Data>An unhandled exception has occurred.</Data>
<Data>30336b89c6e34e1e98387c2026f928a3</Data>
<Data>14</Data>
<Data>11</Data>
<Data>0</Data>
<Data>/LM/W3SVC/2/ROOT/Web-2-132456334351742952</Data>
<Data>Full</Data>
<Data>/WebSYS</Data>
<Data>WEB-SRV2</Data>
<Data />
<Data>3772</Data>
<Data>w3wp.exe</Data>
<Data>Exception</Data>
<Data>CACHE_DATABASE_CONNECTIONS : cache error! at Webserver.Caching.Cache.Put(String key, Object val) at very very very long text here</Data>
</EventData>
</Event>
自定义事件过滤器是什么?我试过这个,它触发了:
<QueryList>
<Query Id="0" Path="Application">
<Select Path="System">*[System[(Level=3) and (EventID=1309)]]</Select>
</Query>
</QueryList>
然后我想结合错误描述,但没有成功:
<QueryList>
<Query Id="0" Path="Application">
<Select Path="System">*[System[(Level=3) and (EventID=1309)]]
and (Data='CACHE_DATABASE_CONNECTIONS$')
</Select>
</Query>
</QueryList>