Skip to content

Commit 10f9f0a

Browse files
committed
Add eventid check to the Agent TOML
1 parent 90f466e commit 10f9f0a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

plugins/inputs/windows_event_log/wineventlog/wineventlog.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ func NewEventLog(name string, levels []string, eventIDs []int, logGroupName, log
8888
}
8989

9090
func (w *windowsEventLog) Init() error {
91+
for _, eventID := range w.eventIDs {
92+
if eventID < 0 || eventID > 65535 {
93+
return fmt.Errorf("invalid event ID: %d, event IDs must be between 0 and 65535", eventID)
94+
}
95+
}
96+
9197
go w.stateManager.Run(state.Notification{Done: w.done})
9298
restored, _ := w.stateManager.Restore()
9399
w.eventOffset = restored.Last().EndOffset()

0 commit comments

Comments
 (0)