简体   繁体   English

查询.evtx转换为.xml

[英]Query .evtx converted to .xml

Having used evtx_dump.py to convert.evtx files to.xml i seek to learn how to query it using XQuery or whatever helps me datamine the document using BaseX.在使用 evtx_dump.py 将.evtx 文件转换为.xml 之后,我试图学习如何使用 XQuery 查询它,或者任何有助于我使用 BaseX 对文档进行数据挖掘的方法。

At this point whatever i try i can only query the whole document using //Events此时,无论我尝试什么,我都只能使用 //Events 查询整个文档

When i define a path such as //Events/Event/System/[EventID = '4688'] i get 0 results.当我定义诸如 //Events/Event/System/[EventID = '4688'] 之类的路径时,我得到 0 个结果。

This first query is to simply track all specific EventID matching a specific value.第一个查询是简单地跟踪与特定值匹配的所有特定 EventID。

Being new to BaseX and XQuery i found the documentation hard to apply to this use case.作为 BaseX 和 XQuery 的新手,我发现文档很难应用于这个用例。

I looked for tools to help me build an XQuery to no avail.我寻找工具来帮助我构建 XQuery 无济于事。

BaseX has all index features enabled i could find. BaseX 启用了我能找到的所有索引功能。

Br,溴,

Joris乔里斯

When XQuery fails to return data you are expecting it is often caused by the presence XML namespaces.当 XQuery 未能返回您所期望的数据时,通常是由存在 XML 命名空间引起的。

The Microsoft XML event log uses a XML namespace on Event nodes and it is inherited by their children. Microsoft XML 事件日志在事件节点上使用 XML 命名空间,并由其子节点继承。 This is the xmlns='http://schemas.microsoft.com/win/2004/08/events/event' you can see in the files.这是您可以在文件中看到的xmlns='http://schemas.microsoft.com/win/2004/08/events/event' Eg例如

    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <Events><Event xmlns='http://schemas.microsoft.com/win/2004/08/events/event'>
   <System><Provider Name='SideBySide'/><EventID Qualifiers='49409'>59</EventID><Version>0</Version>
    ...

Your XQuery must adjust for that.您的 XQuery 必须为此进行调整。 Either by saying any namespace is ok (using *: )通过说任何命名空间都可以(使用*:

//*:System/[*:EventID = '4688'] 

or by explicitly specifing the expected namespaces.或通过明确指定预期的命名空间。

declare namespace ns="http://schemas.microsoft.com/win/2004/08/events/event";
/Events/ns:Event/ns:System[ns:EventID= '4688' ]

See this similar issue xquery-not-working-with-namespaces看到这个类似的问题xquery-not-working-with-namespaces

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM