Skip to content

Handle single-object Filebeat registries during log cleanup - #1186

Closed
sylvesterkaczmarek wants to merge 3 commits into
cisagov:mainfrom
sylvesterkaczmarek:fix/filebeat-single-object-registry-1165
Closed

sylvesterkaczmarek wants to merge 3 commits into
cisagov:mainfrom
sylvesterkaczmarek:fix/filebeat-single-object-registry-1165

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown
Contributor

Fixes #1165.

Summary

  • Normalize a standalone JSON registry object into a one-element list locally in load_filebeat_registries, preserving JSON arrays and NDJSON behavior.
  • Keep device/inode numeric conversion, incomplete-record handling, and registered log protection unchanged.
  • Add six focused regression tests covering JSON formats, multiple registries, and actual pruning of old unregistered logs while preserving registered logs.

Verification

  • python3 -m unittest discover -s scripts/installer/tests/unit -p test_filebeat_registry_cleanup.py -v: 6 passed.
  • git diff --check: passed.
  • Based on current upstream main (7cfac5bc).
  • No running deployment or production logs were modified.

@mmguero

mmguero commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

duplicate of #1168

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.

A single-object Filebeat registry aborts log cleanup

2 participants