xpathがわかりません。私はW3チュートリアルを見てきましたが、うまくいかないようです。特定の時刻以降にイベントを取得するためにwevtutilでxpathを使用する方法
私は、次のコマンドを使用して、ちょうど最後の3つのイベント一覧表示した場合、私は、Windows Server 2008 R2エンタープライズ
によWindowsイベントログ
からイベントを抽出するためにwevtutilを使用しています:
をwevtutil qe Application /c:3 /rd:true /e:root
私は次のような結果を得る:あなたのよう
<?xml version="1.0"?>
<root>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider EventSourceName="Software Protection Platform Service" Guid="{E23B33B0-C8C9-472C-A5F9-F2BDFEA0F156}" Name="Microsoft-Windows-Security-SPP"/>
<EventID Qualifiers="16384">902</EventID>
<Version>0</Version>
<Level>0</Level>
<Task>0</Task>
<Opcode>0</Opcode>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2016-04-22T08:20:30.000000000Z"/>
<EventRecordID>49232</EventRecordID>
<Correlation/>
<Execution ThreadID="0" ProcessID="0"/>
<Channel>Application</Channel>
<Computer>EU9742K8WEB01.emea.sitel-world.net</Computer>
<Security/>
</System>
<EventData>
<Data>6.1.7601.17514</Data>
</EventData>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider EventSourceName="Software Protection Platform Service" Guid="{E23B33B0-C8C9-472C-A5F9-F2BDFEA0F156}" Name="Microsoft-Windows-Security-SPP"/>
<EventID Qualifiers="16384">1003</EventID>
<Version>0</Version>
<Level>4</Level>
<Task>0</Task>
<Opcode>0</Opcode>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2016-04-22T08:20:30.000000000Z"/>
<EventRecordID>49231</EventRecordID>
<Correlation/>
<Execution ThreadID="0" ProcessID="0"/>
<Channel>Application</Channel>
<Computer>EU9742K8WEB01.emea.sitel-world.net</Computer>
<Security/>
</System>
<EventData>
<Data>55c92734-d682-4d71-983e-d6ec3f16059f</Data>
<Data>1: 0cb1d6b4-3c07-487f-82fc-886d44a646aa, 1, 0 [(0 [0xC004F014, 0, 0], [(?)(?)(?)(?)(?)(?)])(1)(2)]2: 2d727362-1f80-4a74-9e4d-e7c79826e659, 1, 0 [(0 [0xC004F014, 0, 0], [(?)(?)(?)(?)(?)(?)])(1)(2)]3: 4bcc8879-e699-4159-a810-f829566662ca, 1, 0 [(0 [0xC004F014, 0, 0], [(?)(?)(?)(?)(?)(?)])(1)(2)]4: 620e2b3d-09e7-42fd-802a-17a13652fe7a, 1, 1 [(0 [0x00000000, 1, 0], [(?)(?)(1 0x00000000 30 0 msft:rm/algorithm/volume/1.0 0x00000000 254400)(?)(?)(?)])(1)(2)]5: 6a4bd364-4b60-4856-a727-efb59d94348e, 1, 0 [(0 [0xC004F014, 0, 0], [(?)(?)(?)(?)(?)(?)])(1)(2)]6: 8fe15d04-fc66-40e6-bf34-942481e06fd8, 1, 0 [(0 [0xC004F014, 0, 0], [(?)(?)(?)(?)(?)(?)])(1)(2)]7: b297426d-464d-4af1-abb2-3474aeecb878, 1, 0 [(0 [0xC004F014, 0, 0], [(?)(?)(?)(?)(?)(?)])(1)(2)]8: c60b048b-8071-4532-8398-f15f4c981861, 1, 0 [(0 [0xC004F014, 0, 0], [(?)(?)(?)(?)(?)(?)])(1)(2)]9: c74dc7f6-ea35-4bd7-9776-333ab5dddae6, 1, 0 [(0 [0xC004F014, 0, 0], [(?)(?)(?)(?)(?)(?)])(1)(2)]10: c99b641f-c4ea-4e63-bec3-5ed2ccd0f357, 1, 0 [(0 [0xC004F014, 0, 0], [(?)(?)(?)(?)(?)(?)])(1)(2)]11: ea36520d-fbfe-4042-acd8-fe926781b615, 1, 0 [(0 [0xC004F014, 0, 0], [(?)(?)(?)(?)(?)(?)])(1)(2)]</Data>
</EventData>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider EventSourceName="Software Protection Platform Service" Guid="{E23B33B0-C8C9-472C-A5F9-F2BDFEA0F156}" Name="Microsoft-Windows-Security-SPP"/>
<EventID Qualifiers="16384">1066</EventID>
<Version>0</Version>
<Level>4</Level>
<Task>0</Task>
<Opcode>0</Opcode>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2016-04-22T08:20:30.000000000Z"/>
<EventRecordID>49230</EventRecordID>
<Correlation/>
<Execution ThreadID="0" ProcessID="0"/>
<Channel>Application</Channel>
<Computer>EU9742K8WEB01.emea.sitel-world.net</Computer>
<Security/>
</System>
<EventData>
<Data>C:\Windows\system32\sppwinob.dll, msft:spp/windowsfunctionality/agent/7.0, 0x00000000, 0x00000000C:\Windows\system32\sppobjs.dll, msft:rm/algorithm/phone/1.0, 0x00000000, 0x00000000C:\Windows\system32\sppobjs.dll, msft:rm/algorithm/pkey/2005, 0x00000000, 0x00000000C:\Windows\system32\sppobjs.dll, msft:spp/TaskScheduler/1.0, 0x00000000, 0x00000000C:\Windows\system32\sppobjs.dll, msft:spp/volume/services/kms/1.0, 0x00000000, 0x00000000C:\Windows\system32\sppobjs.dll, msft:spp/volume/services/kms/licenserenewal/1.0, 0x00000000, 0x00000000</Data>
</EventData>
</Event>
</root>
をSystemTime属性を持つTimeCreated要素があることがわかります。私は2回の間にSystemTimeのものだけを言いたい。
私は私の前のコマンドにXPathを追加する場合:
wevtutil qe Application /c:3 /rd:true /e:root /q:"TimeCreated"
返すすべては次のとおりです。
<root>
</root>
私はEvent/System/TimeCreated
にXPathを変更する場合は、上記のように、私は同じXMLを取得します。
ので、2つの質問:
私は他のすべての要素(この1つは私にとってそれほど重要ではない)することなく、単にTimeCreated要素を取得するにはどうすればよいですか?
SystemTime属性が指定された2つの値の間にある場所を取得する方法を教えてください。
とW3のチュートリアルで提案されているように、私はちょうどそれ自身にTimeCreatedを使用することはできませんなぜ誰かが私に説明できるならば、それもいいだろう。
http://www.w3schools.com/xsl/xpath_syntax.asp
XPathはこれを書き留める方法ではありませんが、それは近いです。 – Tomalak