fix: per-host filter not applied in syslogsummary PDO ConsolidateDataByField#129
Merged
Merged
Conversation
…sue #71) Agent-Logs-Url: https://github.com/rsyslog/loganalyzer/sessions/95499932-66e0-425d-baa3-1e76ad3972bf Co-authored-by: alorbach <1675286+alorbach@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
alorbach
May 6, 2026 14:26
View session
Member
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
In the syslog summary PDF report, every host section showed messages from all hosts instead of only that host's messages. Summary counts were correct; only the per-host consolidated message lists were unfiltered.
Root cause
ConsolidateSyslogmessagesPerHostresets and rebuilds filters on each loop iteration:logstreampdo.class.php'sConsolidateDataByFieldconsumed_SQLwhereClausedirectly without detecting the empty/stale state and rebuilding it from_filters. The mysqli backend (logstreamdb.class.php) already handles this correctly, and so does the PDOConsolidateItemListByField— onlyConsolidateDataByFieldin the PDO path was missing the guard.Fix
Added the same stale-clause guard already present in both sibling methods:
This also corrects the same latent bug in
ConsolidateEventsPerHost(eventsummary) for PDO-backed sources.Summary by cubic
Fixes per-host sections in the syslog summary (PDO backend) showing messages from all hosts by rebuilding the SQL WHERE clause from active filters when needed. Also corrects the same issue in the event summary.
ConsolidateDataByFieldwhen empty to apply current filters.Written for commit 81fbdc6. Summary will update on new commits.