Skip to content

Commit 730969d

Browse files
feat(sources): Add Windows Event Log source implementation
Implement comprehensive Windows Event Log source with full feature parity to FluentBit's winevtlog plugin, including: - Multi-channel support with configurable polling - Advanced filtering (event ID, level, XPath queries, provider filtering) - XML event parsing and field extraction - Bookmark persistence for position tracking - Comprehensive error handling and recovery - Rich internal events for observability - Extensive unit test coverage (500+ lines) - Windows API integration via windows crate The implementation follows Vector's architecture patterns and coding standards, with proper feature gating and conditional compilation. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent badeb4a commit 730969d

File tree

11 files changed

+3491
-6
lines changed

11 files changed

+3491
-6
lines changed

Cargo.lock

Lines changed: 52 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,8 @@ byteorder = "1.5.0"
429429

430430
[target.'cfg(windows)'.dependencies]
431431
windows-service = "0.8.0"
432+
windows = { version = "0.58", features = ["Win32_System_EventLog", "Win32_Foundation", "Win32_System_Com"], optional = true }
433+
quick-xml = { version = "0.31", default-features = false, features = ["serialize"], optional = true }
432434

433435
[target.'cfg(unix)'.dependencies]
434436
nix = { version = "0.26.2", default-features = false, features = ["socket", "signal"] }
@@ -490,7 +492,7 @@ docs = ["api", "api-client", "enrichment-tables", "sinks", "sources", "sources-d
490492
default-cmake = ["api", "api-client", "enrichment-tables", "rdkafka?/cmake_build", "sinks", "sources", "sources-dnstap", "transforms", "unix", "rdkafka?/gssapi-vendored", "secrets"]
491493
# Default features for *-pc-windows-msvc
492494
# TODO: Enable SASL https://github.com/vectordotdev/vector/pull/3081#issuecomment-659298042
493-
default-msvc = ["api", "api-client", "enrichment-tables", "rdkafka?/cmake_build", "sinks", "sources", "transforms", "secrets"]
495+
default-msvc = ["api", "api-client", "enrichment-tables", "rdkafka?/cmake_build", "sinks", "sources", "sources-windows_eventlog", "transforms", "secrets"]
494496
default-musl = ["api", "api-client", "enrichment-tables", "rdkafka?/cmake_build", "sinks", "sources", "sources-dnstap", "transforms", "unix", "rdkafka?/gssapi-vendored", "secrets"]
495497
default-no-api-client = ["api", "enrichment-tables", "sinks", "sources", "sources-dnstap", "transforms", "unix", "rdkafka?/gssapi-vendored", "secrets"]
496498
default-no-vrl-cli = ["api", "sinks", "sources", "sources-dnstap", "transforms", "unix", "rdkafka?/gssapi-vendored", "secrets"]
@@ -613,6 +615,7 @@ sources-logs = [
613615
"sources-syslog",
614616
"sources-vector",
615617
"sources-websocket",
618+
"sources-windows_eventlog",
616619
]
617620
sources-metrics = [
618621
"dep:prost",
@@ -688,6 +691,7 @@ sources-utils-net-tcp = ["listenfd", "dep:ipnet"]
688691
sources-utils-net-udp = ["listenfd"]
689692
sources-utils-net-unix = []
690693
sources-websocket = ["dep:tokio-tungstenite"]
694+
sources-windows_eventlog = ["dep:windows", "dep:quick-xml"]
691695

692696
sources-vector = ["dep:prost", "dep:tonic", "protobuf-build"]
693697

src/internal_events/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ mod websocket;
141141
mod websocket_server;
142142
#[cfg(feature = "transforms-window")]
143143
mod window;
144+
#[cfg(feature = "sources-windows_eventlog")]
145+
mod windows_eventlog;
144146

145147
#[cfg(any(
146148
feature = "sources-file",
@@ -292,6 +294,8 @@ pub(crate) use self::websocket_server::*;
292294
pub(crate) use self::window::*;
293295
#[cfg(windows)]
294296
pub(crate) use self::windows::*;
297+
#[cfg(all(windows, feature = "sources-windows_eventlog"))]
298+
pub(crate) use self::windows_eventlog::*;
295299

296300
pub use self::{
297301
adaptive_concurrency::*, batch::*, common::*, conditions::*, encoding_transcode::*,

0 commit comments

Comments
 (0)