Skip to content

[confgenerator] Fix Message, EventCategory and EventType in windows_event_log_v1.#2198

Merged
franciscovalentecastro merged 4 commits into
masterfrom
fcovalente-fix-winlogv1
Feb 11, 2026
Merged

[confgenerator] Fix Message, EventCategory and EventType in windows_event_log_v1.#2198
franciscovalentecastro merged 4 commits into
masterfrom
fcovalente-fix-winlogv1

Conversation

@franciscovalentecastro
Copy link
Copy Markdown
Contributor

@franciscovalentecastro franciscovalentecastro commented Feb 5, 2026

Description

Details :

  • Parses the original XML record to preserve non-rendered and non-parsed fields.
  • Uses ContainValues to check for EventType cases in the old Windows Event Log API.

Notes :

Related issue

How has this been tested?

Checklist:

  • Unit tests
    • Unit tests do not apply.
    • Unit tests have been added/modified and passed for this PR.
  • Integration tests
    • Integration tests do not apply.
    • Integration tests have been added/modified and passed for this PR.
  • Documentation
    • This PR introduces no user visible changes.
    • This PR introduces user visible changes and the corresponding documentation change has been made.
  • Minor version bump
    • This PR introduces no new features.
    • This PR introduces new features, and there is a separate PR to bump the minor version since the last release already.
    • This PR bumps the version.

Footnotes

  1. https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.145.0/receiver/windowseventlogreceiver

@franciscovalentecastro franciscovalentecastro changed the title [confgenerator] Fix Message EventCategory and EventType in windows_event_log_v1. [confgenerator] Fix Message, EventCategory and EventType in windows_event_log_v1. Feb 5, 2026
@franciscovalentecastro franciscovalentecastro changed the title [confgenerator] Fix Message, EventCategory and EventType in windows_event_log_v1. [draft, confgenerator] Fix Message, EventCategory and EventType in windows_event_log_v1. Feb 5, 2026
@franciscovalentecastro franciscovalentecastro changed the title [draft, confgenerator] Fix Message, EventCategory and EventType in windows_event_log_v1. [confgenerator] Fix Message, EventCategory and EventType in windows_event_log_v1. Feb 10, 2026
@franciscovalentecastro franciscovalentecastro marked this pull request as ready for review February 10, 2026 22:35
Comment on lines 881 to 895
"jsonPayload.channel": {OmitIf: `jsonPayload.channel =~ ".*"`},
"jsonPayload.computer": {OmitIf: `jsonPayload.computer =~ ".*"`},
"jsonPayload.details": {OmitIf: `jsonPayload.details != nil`},
"jsonPayload.event_data": {OmitIf: `jsonPayload.event_data != nil`},
"jsonPayload.event_id": {OmitIf: `jsonPayload.event_id != nil`},
"jsonPayload.execution": {OmitIf: `jsonPayload.execution != nil`},
"jsonPayload.keywords": {OmitIf: `jsonPayload.keywords != nil`},
"jsonPayload.level": {OmitIf: `jsonPayload.level =~ ".*"`},
"jsonPayload.message": {StaticValue: &defaultMessage},
"jsonPayload.opcode": {OmitIf: `jsonPayload.opcode =~ ".*"`},
"jsonPayload.provider": {OmitIf: `jsonPayload.provider != nil`},
"jsonPayload.record_id": {OmitIf: `jsonPayload.record_id != nil`},
"jsonPayload.security": {OmitIf: `jsonPayload.security != nil`},
"jsonPayload.system_time": {OmitIf: `jsonPayload.system_time =~ ".*"`},
"jsonPayload.task": {OmitIf: `jsonPayload.task =~ ".*"`},
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can just set jsonPayload directly:

"jsonPayload": {StaticValue: &defaultMessage},

instead of having to enumerate all the individual fields.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work at the moment, probably we would have to update the Lua Accessor implementation :

go test ./transformation_test -update
--- FAIL: TestTransformationTests (3.01s)
    --- FAIL: TestTransformationTests/logging_processor-windows_event_log_raw_xml (2.99s)
        --- FAIL: TestTransformationTests/logging_processor-windows_event_log_raw_xml/fluent-bit (0.00s)
panic: failed to convert jsonPayload to Lua accessor: field "jsonPayload" not found [recovered]
        panic: failed to convert jsonPayload to Lua accessor: field "jsonPayload" not found

goroutine 187 [running]:
testing.tRunner.func1.2({0x3051680, 0xc001d16f80})
        /usr/local/google/home/fcovalente/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.4.linux-amd64/src/testing/testing.go:1734 +0x21c
testing.tRunner.func1()
        /usr/local/google/home/fcovalente/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.4.linux-amd64/src/testing/testing.go:1737 +0x35e
panic({0x3051680?, 0xc001d16f80?})
        /usr/local/google/home/fcovalente/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.4.linux-amd64/src/runtime/panic.go:792 +0x132
github.com/GoogleCloudPlatform/ops-agent/confgenerator.LoggingProcessorModifyFields.Components(...)
        /usr/local/google/h

@franciscovalentecastro franciscovalentecastro merged commit 5bffae5 into master Feb 11, 2026
64 of 80 checks passed
@franciscovalentecastro franciscovalentecastro deleted the fcovalente-fix-winlogv1 branch February 11, 2026 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants