Skip to content

Commit ae3e3f9

Browse files
mergify[bot]efd6
andauthored
winlogbeat/eventlog: don't attempt to salvage messages for forwarded events (#34865) (#35539)
(cherry picked from commit cc91e1c) Co-authored-by: Dan Kortschak <[email protected]>
1 parent afdafa1 commit ae3e3f9

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

CHANGELOG.next.asciidoc

+3
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ https://github.com/elastic/beats/compare/v8.2.0\...main[Check the HEAD diff]
7373

7474

7575
*Filebeat*
76+
7677
- [Auditbeat System Package] Added support for Apple Silicon chips. {pull}34433[34433]
7778
- [Azure blob storage] Changed logger field name from `container` to `container_name` so that it does not clash
7879
with the ecs field name `container`. {pull}34403[34403]
@@ -123,6 +124,7 @@ https://github.com/elastic/beats/compare/v8.2.0\...main[Check the HEAD diff]
123124
- Move repeated Windows event channel not found errors in winlog input to debug level. {issue}35314[35314] {pull}35317[35317]
124125
- Fix crash when processing forwarded logs missing a message. {issue}34705[34705] {pull}34865[34865]
125126
- Fix crash when loading azurewebstorage cursor with no partially processed data. {pull}35433[35433]
127+
- Fix crash when processing forwarded logs missing a message. {issue}34705[34705] {pull}34865[34865]
126128

127129
*Heartbeat*
128130

@@ -206,6 +208,7 @@ automatic splitting at root level, if root level element is an array. {pull}3415
206208
- Move repeated channel not found errors to debug level. {issue}35314[35314] {pull}35317[35317]
207209
- Fix panic due to misrepresented buffer use. {pull}35437[35437]
208210
- Allow program termination when attempting to open an absent channel. {pull}35474[35474]
211+
- Fix crash when processing forwarded logs missing a message. {issue}34705[34705] {pull}34865[34865]
209212

210213
*Functionbeat*
211214

winlogbeat/eventlog/wineventlog.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,9 @@ func newWinEventLog(options *conf.C) (EventLog, error) {
287287
l.render = func(event win.EvtHandle, out io.Writer) error {
288288
return win.RenderEvent(event, c.EventLanguage, l.renderBuf, l.cache.get, out)
289289
}
290-
}
291-
l.message = func(event win.EvtHandle) (string, error) {
292-
return win.Message(event, l.renderBuf, l.cache.get)
290+
l.message = func(event win.EvtHandle) (string, error) {
291+
return win.Message(event, l.renderBuf, l.cache.get)
292+
}
293293
}
294294

295295
return l, nil
@@ -463,7 +463,7 @@ func (l *winEventLog) Read() ([]Record, error) {
463463
l.metrics.logError(err)
464464
logp.Warn("%s failed creating bookmark: %v", l.logPrefix, err)
465465
}
466-
if r.Message == "" {
466+
if r.Message == "" && l.message != nil {
467467
r.Message, err = l.message(h)
468468
if err != nil {
469469
l.metrics.logError(err)

0 commit comments

Comments
 (0)