Struct s4lib::readers::evtxreader::EvtxReader
source · pub struct EvtxReader { /* private fields */ }
Expand description
A wrapper for using EvtxParser
to read a evtx format file.
An EvtxReader
presumes the file events are not stored in chronological
order.
.evtx
files in the wild were found to store events in a non-chronological
order, e.g. the XML value at Event.System.TimeCreated
are not
necessarily in ascending order.
About 2/3 of the files on a long-running Windows 11 system were found to be
in this “out of order” state.
More accurately, using evtx_dump
to dump a .evtx
file displayed events
evtx_dump
).
Either way, that is the underlying
library used to read the .evtx
files so it’s a problem for this
program.
This EvtxReader
wrapper sorts the events by timestamp and then by
order of enumeration.
Unfortunately, this means the entire file must be read into memory before
Events can be further processed and then printed.
Also see Issue #86.
Implementations§
source§impl<'a> EvtxReader
impl<'a> EvtxReader
Implement the EvtxReader.
sourcepub fn new(path: FPath, filetype: FileType) -> Result<EvtxReader>
pub fn new(path: FPath, filetype: FileType) -> Result<EvtxReader>
Create a new EvtxReader
.
NOTE: should not attempt any file reads here, similar to other
*Readers::new()
pub fn mtime(&self) -> SystemTime
sourcepub fn analyze(
&mut self,
dt_filter_after: &DateTimeLOpt,
dt_filter_before: &DateTimeLOpt
)
pub fn analyze( &mut self, dt_filter_after: &DateTimeLOpt, dt_filter_before: &DateTimeLOpt )
Read the entire file and store in order.
This should be called once before reading the via next
.
pub fn next(&mut self) -> Option<Evtx>
sourcepub fn count_events_processed(&self) -> Count
pub fn count_events_processed(&self) -> Count
Count
of Evtx
s processed by this EvtxReader
(i.e. self.events_processed
).
pub fn count_events_accepted(&self) -> Count
pub const fn path(&self) -> &FPath
pub const fn filetype(&self) -> FileType
pub const fn filesz(&self) -> FileSz
sourcepub fn dt_first_processed(&self) -> DateTimeLOpt
pub fn dt_first_processed(&self) -> DateTimeLOpt
return the DateTimeL
of the first Evtx
processed
sourcepub fn dt_last_processed(&self) -> DateTimeLOpt
pub fn dt_last_processed(&self) -> DateTimeLOpt
return the DateTimeL
of the last Evtx
processed
sourcepub fn dt_first_accepted(&self) -> DateTimeLOpt
pub fn dt_first_accepted(&self) -> DateTimeLOpt
return the DateTimeL
of the first Evtx
accepted by the datetime
filters
sourcepub fn dt_last_accepted(&self) -> DateTimeLOpt
pub fn dt_last_accepted(&self) -> DateTimeLOpt
return the DateTimeL
of the last Evtx
accepted by the datetime
filters
sourcepub fn summary(&self) -> SummaryEvtxReader
pub fn summary(&self) -> SummaryEvtxReader
Return an up-to-date SummaryEvtxReader
instance for this
EvtxReader
.
sourcepub fn summary_complete(&self) -> Summary
pub fn summary_complete(&self) -> Summary
Return an up-to-date Summary
instance for this EvtxReader
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EvtxReader
impl !RefUnwindSafe for EvtxReader
impl Send for EvtxReader
impl Sync for EvtxReader
impl Unpin for EvtxReader
impl !UnwindSafe for EvtxReader
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more