Caution
Grafana Agent has reached End-of-Life (EOL) on November 1, 2025. Agent is no longer receiving vendor support and will no longer receive security or bug fixes. Current users of Agent Static mode, Agent Flow mode, and Agent Operator should proceed with migrating to Grafana Alloy. If you have already migrated to Alloy, no further action is required. Read more about why we recommend migrating to Grafana Alloy.
loki.source.windowsevent
loki.source.windowsevent reads events from Windows Event Logs and forwards them to other
loki.* components.
Multiple loki.source.windowsevent components can be specified by giving them
different labels.
Usage
loki.source.windowsevent "LABEL" {
eventlog_name = EVENTLOG_NAME
forward_to = RECEIVER_LIST
}Arguments
The component starts a new reader and fans out
log entries to the list of receivers passed in forward_to.
loki.source.windowsevent supports the following arguments:
NOTE:
eventlog_nameis required ifxpath_querydoes not specify the event log. You can definexpath_queryin short or xml form. When using the XML form you can specifyevent_login thexpath_query. If using short form, you must defineeventlog_name.
Note
legacy_bookmark_pathis used to convert the Grafana Agent Static to a Grafana Agent Flow bookmark, ifbookmark_pathdoes not exist.
Component health
loki.source.windowsevent is only reported as unhealthy if given an invalid
configuration.
Example
This example collects log entries from the Event Log specified in eventlog_name and
forwards them to a loki.write component so they are written to Loki.
loki.source.windowsevent "application" {
eventlog_name = "Application"
forward_to = [loki.write.endpoint.receiver]
}
loki.write "endpoint" {
endpoint {
url ="loki:3100/api/v1/push"
}
}Compatible components
loki.source.windowsevent can accept arguments from the following components:
- Components that export Loki
LogsReceiver
Note
Connecting some components may not be sensible or components may require further configuration to make the connection work correctly. Refer to the linked documentation for more details.



