Windows Event Log
Collect logs from Windows Event Log channels using the native Windows Event Log API
Requirements
Configuration
Example configurations
{
"sources": {
"my_source_id": {
"type": "windows_event_log",
"channels": [
"System,Application,Security"
]
}
}
}[sources.my_source_id]
type = "windows_event_log"
channels = [ "System,Application,Security" ]
sources:
my_source_id:
type: windows_event_log
channels:
- System,Application,Security
{
"sources": {
"my_source_id": {
"type": "windows_event_log",
"batch_size": 100,
"channels": [
"System,Application,Security"
],
"checkpoint_interval_secs": 5,
"connection_timeout_secs": 30,
"data_dir": "/var/lib/vector",
"event_query": "*[System[Level=1 or Level=2 or Level=3]]",
"event_timeout_ms": 5000,
"events_per_second": 100,
"ignore_event_ids": [
4624
],
"max_event_age_secs": 86400,
"max_event_data_length": 1024,
"only_event_ids": [
1000
],
"render_message": true
}
}
}[sources.my_source_id]
type = "windows_event_log"
batch_size = 100
channels = [ "System,Application,Security" ]
checkpoint_interval_secs = 5
connection_timeout_secs = 30
data_dir = "/var/lib/vector"
event_query = "*[System[Level=1 or Level=2 or Level=3]]"
event_timeout_ms = 5_000
events_per_second = 100
ignore_event_ids = [ 4_624 ]
max_event_age_secs = 86_400
max_event_data_length = 1_024
only_event_ids = [ 1_000 ]
render_message = true
sources:
my_source_id:
type: windows_event_log
batch_size: 100
channels:
- System,Application,Security
checkpoint_interval_secs: 5
connection_timeout_secs: 30
data_dir: /var/lib/vector
event_query: "*[System[Level=1 or Level=2 or Level=3]]"
event_timeout_ms: 5000
events_per_second: 100
ignore_event_ids:
- 4624
max_event_age_secs: 86400
max_event_data_length: 1024
only_event_ids:
- 1000
render_message: true
acknowledgements
optional objectDeprecated
Controls how acknowledgements are handled for this source.
When enabled, the source will wait for downstream sinks to acknowledge receipt of events before updating checkpoints. This provides exactly-once delivery guarantees at the cost of potential duplicate events on restart if acknowledgements are pending.
When disabled (default), checkpoints are updated immediately after reading events, which may result in data loss if Vector crashes before events are delivered to sinks.
acknowledgements.enabled
optional boolbatch_size
optional uintBatch size for event processing.
This controls how many events are processed in a single batch.
100channels
required [string]A comma-separated list of channels to read from.
Common channels include “System”, “Application”, “Security”, “Windows PowerShell”. Use Windows Event Viewer to discover available channels.
checkpoint_interval_secs
optional uintInterval in seconds between periodic checkpoint flushes.
Controls how often bookmarks are persisted to disk in synchronous mode. Lower values reduce the window of events that may be re-processed after a crash, at the cost of more frequent disk writes.
5connection_timeout_secs
optional uintConnection timeout in seconds for event subscription.
This controls how long to wait for event subscription connection.
30data_dir
optional string literalThe directory where checkpoint data is stored.
By default, the global data_dir option is used.
Make sure the running user has write permissions to this directory.
event_data_format
optional objectCustom event data formatting options.
Maps event field names to custom formatting options.
event_data_format.*
required string literal enum| Option | Description |
|---|---|
auto | Keep the original format unchanged (passthrough). The field value will not be converted or modified. |
boolean | Parse and format the field value as a boolean. Recognizes “true”, “1”, “yes”, “on” as true (case-insensitive). |
float | Parse and format the field value as a floating-point number. |
integer | Parse and format the field value as an integer. |
string | Format the field value as a string. |
event_query
optional string literalThe XPath query for filtering events.
Allows filtering events using XML Path Language queries. If not specified, all events from the specified channels will be collected.
event_timeout_ms
optional uintTimeout in milliseconds for waiting for new events.
Controls the maximum time WaitForMultipleObjects blocks before
returning to check for shutdown signals. Lower values increase
shutdown responsiveness at the cost of more frequent wake-ups.
5000events_per_second
optional uintMaximum number of events to process per second.
When set to a non-zero value, Vector will rate-limit event processing to prevent overwhelming downstream systems. A value of 0 (default) means no rate limiting is applied.
field_filter
optional objectEvent field inclusion/exclusion patterns.
Controls which event fields are included in the output.
field_filter.exclude_fields
optional [string]Fields to exclude from the output.
These fields will be removed from the event data.
field_filter.include_event_data
optional boolWhether to include event data fields.
Event data fields contain application-specific data.
truefield_filter.include_fields
optional [string]Fields to include in the output.
If specified, only these fields will be included.
field_filter.include_system_fields
optional boolWhether to include system fields.
System fields include metadata like Computer, TimeCreated, etc.
truefield_filter.include_user_data
optional boolWhether to include user data fields.
User data fields contain additional custom data.
trueignore_event_ids
optional [uint]Ignore specific event IDs.
Events with these IDs will be filtered out and not sent downstream.
include_xml
optional boolWhether to include raw XML data in the output.
When enabled, the raw XML representation of the event is included
in the xml field of the output event.
falsemax_event_age_secs
optional uintMaximum age of events to process (in seconds).
Events older than this value will be ignored. If not specified, all events will be processed regardless of age.
max_event_data_length
optional uintMaximum length for event data field values.
Event data values longer than this will be truncated with “…[truncated]” appended. Set to 0 for no limit.
only_event_ids
optional [uint]Only include specific event IDs.
If specified, only events with these IDs will be processed.
Takes precedence over ignore_event_ids.
read_existing_events
optional boolWhether to read existing events or only new events.
When set to true, the source will read all existing events from the channels.
When set to false (default), only new events will be read.
falserender_message
optional boolWhether to render human-readable event messages.
When enabled (default), Vector will use the Windows EvtFormatMessage API to render localized, human-readable event messages with parameter substitution. This matches the behavior of Windows Event Viewer.
Provider DLL handles are cached per provider, so the performance cost is limited to the first event from each provider. Disable only if you do not need rendered messages and want to eliminate the DLL loads entirely.
trueOutputs
<component_id>
Output Types
Logs
Warning
Event
Fields
SystemApplicationSecurityDESKTOP-ABC123703646241000InformationWarningErrorCriticalThe service was started successfully.Microsoft-Windows-Security-Auditingwindows_event_log2020-10-10T17:07:36.452332ZTelemetry
Metrics
linkcomponent_discarded_events_total
counterfilter transform, or false if due to an error.component_errors_total
countercomponent_received_bytes_total
countercomponent_received_event_bytes_total
countercomponent_received_events_count
histogramA histogram of the number of events passed in each internal batch in Vector’s internal topology.
Note that this is separate than sink-level batching. It is mostly useful for low level debugging performance issues in Vector due to small internal batches.
component_received_events_total
countercomponent_sent_event_bytes_total
countercomponent_sent_events_total
countersource_buffer_max_byte_size
gaugeDeprecated
source_buffer_max_size_bytes.source_buffer_max_event_size
gaugeDeprecated
source_buffer_max_size_events.source_buffer_max_size_bytes
gaugesource_buffer_max_size_events
gaugesource_buffer_utilization
histogramsource_buffer_utilization_level
gaugesource_buffer_utilization_mean
gaugesource_lag_time_seconds
histogramHow it works
Checkpointing
data_dir option, but can be overridden
via the data_dir option in the file source directly.Context
windows_event_log source augments events with helpful
context keys.