Skip to content

[winlogbeat] Fix forwarded event handling and add channel error resilience#46190

Merged
marc-gr merged 10 commits intoelastic:mainfrom
marc-gr:fix/winlogbeat-fw-cache-ignore
Sep 3, 2025
Merged

[winlogbeat] Fix forwarded event handling and add channel error resilience#46190
marc-gr merged 10 commits intoelastic:mainfrom
marc-gr:fix/winlogbeat-fw-cache-ignore

Conversation

@marc-gr
Copy link
Contributor

@marc-gr marc-gr commented Aug 22, 2025

Proposed commit message

Introduces two key fixes to Winlogbeat for better handling of Windows Event Log scenarios:

  • Use XMLRenderer for forwarded events

    • Automatically use XMLRenderer for forwarded events regardless of the include_xml setting
    • Simplifies renderer configuration and ensures proper handling of forwarded event data to prevent cache pollution
  • Add ignore_missing_channel configuration option

    • Prevents Winlogbeat from stopping when encountering ERROR_EVT_CHANNEL_NOT_FOUND errors
    • Useful for deployments across diverse Windows environments where not all event log channels may be present

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Even if this is adding a new option is to be able to prevent elastic-agent to show as degraded in scenarios where before it was not, so we will backport this also

@marc-gr marc-gr added Filebeat Filebeat Winlogbeat Team:Security-Windows Platform Windows Platform Team in Security Solution windows backport-active-8 Automated backport with mergify to all the active 8.[0-9]+ branches backport-active-9 Automated backport with mergify to all the active 9.[0-9]+ branches labels Aug 22, 2025
@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Aug 22, 2025
@github-actions
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@marc-gr marc-gr force-pushed the fix/winlogbeat-fw-cache-ignore branch from c4a5b0a to 50c3cf6 Compare August 22, 2025 13:22
@marc-gr marc-gr marked this pull request as ready for review August 22, 2025 13:22
@marc-gr marc-gr requested review from a team as code owners August 22, 2025 13:22
@elasticmachine
Copy link
Contributor

Pinging @elastic/sec-windows-platform (Team:Security-Windows Platform)

@marc-gr marc-gr force-pushed the fix/winlogbeat-fw-cache-ignore branch from 50c3cf6 to 4a7fe8a Compare August 22, 2025 13:23
@marc-gr marc-gr requested a review from a team as a code owner August 22, 2025 14:09
Copy link
Contributor

@vishaangelova vishaangelova left a comment

Choose a reason for hiding this comment

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

LGTM for the doc changes

PR feedback

Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com>
AndersonQ
AndersonQ previously approved these changes Aug 28, 2025
Copy link
Member

@AndersonQ AndersonQ left a comment

Choose a reason for hiding this comment

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

Looks good, I'll wait the tests pass to approve it.

@AndersonQ AndersonQ dismissed their stale review August 28, 2025 11:45

approved by mistake

@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@marc-gr marc-gr enabled auto-merge (squash) September 3, 2025 14:43
@marc-gr marc-gr merged commit abcb373 into elastic:main Sep 3, 2025
57 of 60 checks passed
@github-actions
Copy link
Contributor

github-actions bot commented Sep 3, 2025

@Mergifyio backport 8.17 8.18 8.19 9.0 9.1

@mergify
Copy link
Contributor

mergify bot commented Sep 3, 2025

mergify bot pushed a commit that referenced this pull request Sep 3, 2025
…ience (#46190)

* Use XMLRenderer for forwarded events

* Include new IgnoreMissingChannel option

* Default to true and add test

* Update CHANGELOG.next.asciidoc

PR feedback

Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com>

* Run mage update

* Add mustIgnoreError to all platforms

* Show example with non default value

---------

Co-authored-by: Nick Fritts <56593026+nfritts@users.noreply.github.com>
Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com>
(cherry picked from commit abcb373)

# Conflicts:
#	docs/reference/filebeat/filebeat-input-winlog.md
#	docs/reference/winlogbeat/configuration-winlogbeat-options.md
#	docs/reference/winlogbeat/winlogbeat-reference-yml.md
#	winlogbeat/eventlog/config.go
#	winlogbeat/eventlog/runner.go
#	winlogbeat/eventlog/wineventlog.go
#	winlogbeat/sys/wineventlog/renderer.go
#	winlogbeat/sys/wineventlog/renderer_test.go
#	x-pack/filebeat/tests/integration/windows/inputs_windows_test.go
mergify bot pushed a commit that referenced this pull request Sep 3, 2025
…ience (#46190)

* Use XMLRenderer for forwarded events

* Include new IgnoreMissingChannel option

* Default to true and add test

* Update CHANGELOG.next.asciidoc

PR feedback

Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com>

* Run mage update

* Add mustIgnoreError to all platforms

* Show example with non default value

---------

Co-authored-by: Nick Fritts <56593026+nfritts@users.noreply.github.com>
Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com>
(cherry picked from commit abcb373)

# Conflicts:
#	docs/reference/filebeat/filebeat-input-winlog.md
#	docs/reference/winlogbeat/configuration-winlogbeat-options.md
#	docs/reference/winlogbeat/winlogbeat-reference-yml.md
#	winlogbeat/eventlog/config.go
#	winlogbeat/eventlog/wineventlog.go
#	winlogbeat/sys/wineventlog/renderer.go
#	x-pack/filebeat/tests/integration/windows/inputs_windows_test.go
mergify bot pushed a commit that referenced this pull request Sep 3, 2025
…ience (#46190)

* Use XMLRenderer for forwarded events

* Include new IgnoreMissingChannel option

* Default to true and add test

* Update CHANGELOG.next.asciidoc

PR feedback

Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com>

* Run mage update

* Add mustIgnoreError to all platforms

* Show example with non default value

---------

Co-authored-by: Nick Fritts <56593026+nfritts@users.noreply.github.com>
Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com>
(cherry picked from commit abcb373)

# Conflicts:
#	docs/reference/filebeat/filebeat-input-winlog.md
#	docs/reference/winlogbeat/configuration-winlogbeat-options.md
#	docs/reference/winlogbeat/winlogbeat-reference-yml.md
#	winlogbeat/eventlog/config.go
#	winlogbeat/eventlog/wineventlog.go
#	winlogbeat/sys/wineventlog/renderer.go
mergify bot pushed a commit that referenced this pull request Sep 3, 2025
…ience (#46190)

* Use XMLRenderer for forwarded events

* Include new IgnoreMissingChannel option

* Default to true and add test

* Update CHANGELOG.next.asciidoc

PR feedback

Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com>

* Run mage update

* Add mustIgnoreError to all platforms

* Show example with non default value

---------

Co-authored-by: Nick Fritts <56593026+nfritts@users.noreply.github.com>
Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com>
(cherry picked from commit abcb373)

# Conflicts:
#	winlogbeat/eventlog/wineventlog.go
mergify bot pushed a commit that referenced this pull request Sep 3, 2025
…ience (#46190)

* Use XMLRenderer for forwarded events

* Include new IgnoreMissingChannel option

* Default to true and add test

* Update CHANGELOG.next.asciidoc

PR feedback

Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com>

* Run mage update

* Add mustIgnoreError to all platforms

* Show example with non default value

---------

Co-authored-by: Nick Fritts <56593026+nfritts@users.noreply.github.com>
Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com>
(cherry picked from commit abcb373)
@nicpenning
Copy link
Contributor

Does Filebeat have the same/similar issue and if so, does this correct it?

@marc-gr marc-gr deleted the fix/winlogbeat-fw-cache-ignore branch September 3, 2025 19:25
@marc-gr
Copy link
Contributor Author

marc-gr commented Sep 3, 2025

Does Filebeat have the same/similar issue and if so, does this correct it?

this corrects both winlogbeat and the winlog input in filebeat

marc-gr added a commit that referenced this pull request Sep 3, 2025
…add channel error resilience (#46368)

* [winlogbeat] Fix forwarded event handling and add channel error resilience (#46190)

* Use XMLRenderer for forwarded events

* Include new IgnoreMissingChannel option

* Default to true and add test

* Update CHANGELOG.next.asciidoc

PR feedback

Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com>

* Run mage update

* Add mustIgnoreError to all platforms

* Show example with non default value

---------

Co-authored-by: Nick Fritts <56593026+nfritts@users.noreply.github.com>
Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com>
(cherry picked from commit abcb373)

* Update CHANGELOG for Winlogbeat fixes

Removed outdated entries and added new fixes for Winlogbeat.

* Change minimum stack version for ignore_missing_channel

Update the minimum supported stack version for ignore_missing_channel option.

* Change minimum stack version for ignore_missing_channel

Update the minimum supported stack version for the ignore_missing_channel option.

---------

Co-authored-by: Marc Guasch <marc-gr@users.noreply.github.com>
Co-authored-by: Nick Fritts <56593026+nfritts@users.noreply.github.com>
Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com>
@nicpenning
Copy link
Contributor

Awesome, thank you!

marc-gr added a commit that referenced this pull request Sep 4, 2025
…add channel error resilience (#46367)

* [winlogbeat] Fix forwarded event handling and add channel error resilience (#46190)

* Use XMLRenderer for forwarded events

* Include new IgnoreMissingChannel option

* Default to true and add test

* Update CHANGELOG.next.asciidoc

PR feedback

Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com>

* Run mage update

* Add mustIgnoreError to all platforms

* Show example with non default value

---------

Co-authored-by: Nick Fritts <56593026+nfritts@users.noreply.github.com>
Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com>
(cherry picked from commit abcb373)

# Conflicts:
#	winlogbeat/eventlog/wineventlog.go

* Resolve conflict

* Fix changelog and docs

---------

Co-authored-by: Marc Guasch <marc-gr@users.noreply.github.com>
Co-authored-by: Marc Guasch <marc.guasch@elastic.co>
marc-gr added a commit that referenced this pull request Sep 5, 2025
…ience (#46190)

* Use XMLRenderer for forwarded events

* Include new IgnoreMissingChannel option

* Default to true and add test

* Update CHANGELOG.next.asciidoc

PR feedback

Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com>

* Run mage update

* Add mustIgnoreError to all platforms

* Show example with non default value

---------

Co-authored-by: Nick Fritts <56593026+nfritts@users.noreply.github.com>
Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com>
(cherry picked from commit abcb373)
marc-gr added a commit that referenced this pull request Sep 5, 2025
…ience (#46190)

* Use XMLRenderer for forwarded events

* Include new IgnoreMissingChannel option

* Default to true and add test

* Update CHANGELOG.next.asciidoc

PR feedback

Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com>

* Run mage update

* Add mustIgnoreError to all platforms

* Show example with non default value

---------

Co-authored-by: Nick Fritts <56593026+nfritts@users.noreply.github.com>
Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com>
(cherry picked from commit abcb373)
marc-gr added a commit that referenced this pull request Sep 5, 2025
…ience (#46190)

* Use XMLRenderer for forwarded events

* Include new IgnoreMissingChannel option

* Default to true and add test

* Update CHANGELOG.next.asciidoc

PR feedback

Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com>

* Run mage update

* Add mustIgnoreError to all platforms

* Show example with non default value

---------

Co-authored-by: Nick Fritts <56593026+nfritts@users.noreply.github.com>
Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com>
(cherry picked from commit abcb373)
marc-gr added a commit that referenced this pull request Sep 5, 2025
…ience (#46190) (#46366)

* Use XMLRenderer for forwarded events

* Include new IgnoreMissingChannel option

* Default to true and add test

* Update CHANGELOG.next.asciidoc

PR feedback



* Run mage update

* Add mustIgnoreError to all platforms

* Show example with non default value

---------



(cherry picked from commit abcb373)

Co-authored-by: Marc Guasch <marc.guasch@elastic.co>
Co-authored-by: Nick Fritts <56593026+nfritts@users.noreply.github.com>
Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com>
marc-gr added a commit that referenced this pull request Sep 5, 2025
…ience (#46190) (#46365)

* Use XMLRenderer for forwarded events

* Include new IgnoreMissingChannel option

* Default to true and add test

* Update CHANGELOG.next.asciidoc

PR feedback



* Run mage update

* Add mustIgnoreError to all platforms

* Show example with non default value

---------



(cherry picked from commit abcb373)

Co-authored-by: Marc Guasch <marc.guasch@elastic.co>
Co-authored-by: Nick Fritts <56593026+nfritts@users.noreply.github.com>
Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-active-8 Automated backport with mergify to all the active 8.[0-9]+ branches backport-active-9 Automated backport with mergify to all the active 9.[0-9]+ branches Filebeat Filebeat Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team Team:Security-Windows Platform Windows Platform Team in Security Solution windows Winlogbeat

8 participants