[system] Replace journald facilities option with SYSLOG_FACILITY matches#20303
Open
nicholasberlin wants to merge 2 commits into
Open
[system] Replace journald facilities option with SYSLOG_FACILITY matches#20303nicholasberlin wants to merge 2 commits into
nicholasberlin wants to merge 2 commits into
Conversation
The auth and syslog journald stream templates hardcoded the `facilities` option, which the Filebeat journald input translates into `journalctl --facility`. That flag was only added in systemd 245, so on hosts with older journalctl (all RHEL 8, which ships 239) journalctl exits with "unrecognized option '--facility'", the reader restarts in an endless loop, and both streams silently collect zero events while reporting Healthy. Replace `facilities` with equivalent `SYSLOG_FACILITY=<n>` entries in `include_matches`. journalctl implements `--facility` internally as SYSLOG_FACILITY matches, and matches on the same field are ORed, so the filtering is identical — but plain field matches work on all journalctl versions. User-supplied include_matches expressions are appended to the same list, preserving the previous AND semantics across different fields. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Elastic Docs Style Checker (Vale)Summary: 1 warning found
|
| File | Line | Rule | Message |
|---|---|---|---|
| packages/system/changelog.yml | 4 | Elastic.Latinisms | Latin terms and abbreviations are a common source of confusion. Use 'for example' instead of 'e.g'. |
The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale.
Contributor
|
✅ All changelog entries have the correct PR link. |
💚 Build Succeeded
|
|
Pinging @elastic/sec-linux-platform (Team:Security-Linux Platform) |
6 tasks
stanek-michal
approved these changes
Jul 23, 2026
This was referenced Jul 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed commit message
The auth and syslog journald stream templates hardcoded the
facilitiesoption, which the Filebeat journald input translates intojournalctl --facility. That flag was only added in systemd 245, so on hosts with older journalctl (all RHEL 8, which ships 239) journalctl exits withunrecognized option '--facility', the reader restarts in an endless loop, and both streams silently collect zero events while reporting Healthy.Replace
facilitieswith equivalentSYSLOG_FACILITY=<n>entries ininclude_matches. journalctl implements--facilityinternally as SYSLOG_FACILITY matches, and matches on the same field are ORed, so the filtering is identical — but plain field matches work on all journalctl versions, and the fix reaches already-deployed 8.17+/9.x agents via a normal integration upgrade without waiting for a stack release. User-suppliedinclude_matchesexpressions are appended to the same list, preserving the previous AND semantics across different fields.Behavior note for reviewers
There is one deliberate semantic change, limited to users who put their own
SYSLOG_FACILITY=<n>expressions in the stream's Include Matches setting. Previously the facility filter and user matches were ANDed by journalctl, so a user-supplied facility outside the hardcoded set produced an empty intersection — zero events, silently. Now that user entry joins the same field group as the built-in facility matches and is ORed, so it adds that facility to the stream instead. The old behavior was indistinguishable from the bug this PR fixes and could not have been used productively; the new semantics are documented in the updatedinclude_matchesvariable descriptions in both data-stream manifests. Matches on any other journal field (e.g._SYSTEMD_UNIT=...) are unaffected — they remain ANDed with the facility filter exactly as before.Checklist
changelog.ymlfile.How to test this PR locally
All four variants pass locally (auth default/journald, syslog default/journald); the journald tests replay real
.journalfiles through an agent and assert exact hit counts (9 auth / 3 syslog), which confirms the SYSLOG_FACILITY matches select the same events the facility filter did.To reproduce the original failure: run the journald input on a host with journalctl < 245 (e.g. RHEL 8, systemd 239) —
journalctlexits 1 withunrecognized option '--facility'and the streams collect nothing.Related issues
--facilityincompatibility reported against the journald input; a dedicated beats issue for capability detection is being filed separately)🤖 Generated with Claude Code