-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(pgaudit): support pgaudit.log_rows
option
#4394
Merged
Merged
Conversation
This file contains 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
phisco
requested review from
fcanovai,
gbartolini,
leonardoce,
mnencia,
sxd and
armru
as code owners
April 28, 2024 12:12
github-actions
bot
added
backport-requested ◀️
This pull request should be backported to all supported releases
release-1.21
release-1.22
release-1.23
labels
Apr 28, 2024
❗ By default, the pull request is configured to backport to all release branches.
|
armru
approved these changes
Jun 11, 2024
gbartolini
force-pushed
the
pgaudit-log-rows
branch
from
June 11, 2024 21:37
a7609dd
to
dabf01d
Compare
/test |
@gbartolini, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/9473112733 |
mnencia
approved these changes
Jun 12, 2024
Signed-off-by: Philippe Scorsolini <p.scorsolini@gmail.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
mnencia
force-pushed
the
pgaudit-log-rows
branch
from
June 12, 2024 09:30
dabf01d
to
588c338
Compare
I propose the following commit message:
|
mnencia
changed the title
feat(pgaudit): correctly parse logs with pgaudit.log_rows on
fix(pgaudit): correctly parse logs with Jun 12, 2024
pgaudit.log_rows
enabled
@mnencia sounds good to me! |
gbartolini
changed the title
fix(pgaudit): correctly parse logs with
fix(pgaudit): support Jun 12, 2024
pgaudit.log_rows
enabledpgaudit.log_rows
option
I agree this is a bug |
cnpg-bot
pushed a commit
that referenced
this pull request
Jun 12, 2024
This patch ensures the correct parsing of the additional `rows` field returned when the `pgaudit.log_rows` option is enabled. Previously, the presence of this field caused audit logs to be incorrectly routed to the normal log stream. Closes #4386 Signed-off-by: Philippe Scorsolini <p.scorsolini@gmail.com> Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com> (cherry picked from commit fb7d2f2)
cnpg-bot
pushed a commit
that referenced
this pull request
Jun 12, 2024
This patch ensures the correct parsing of the additional `rows` field returned when the `pgaudit.log_rows` option is enabled. Previously, the presence of this field caused audit logs to be incorrectly routed to the normal log stream. Closes #4386 Signed-off-by: Philippe Scorsolini <p.scorsolini@gmail.com> Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com> (cherry picked from commit fb7d2f2)
cnpg-bot
pushed a commit
that referenced
this pull request
Jun 12, 2024
This patch ensures the correct parsing of the additional `rows` field returned when the `pgaudit.log_rows` option is enabled. Previously, the presence of this field caused audit logs to be incorrectly routed to the normal log stream. Closes #4386 Signed-off-by: Philippe Scorsolini <p.scorsolini@gmail.com> Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com> (cherry picked from commit fb7d2f2)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backport-requested ◀️
This pull request should be backported to all supported releases
ok to merge 👌
This PR can be merged
release-1.21
release-1.22
release-1.23
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.
Fixes #4386.
Turns out that with pgaudit.log_rows enabled an additional field is appended at the end of the CSV row.
In order to properly handle audit logs with
log_rows
enabled and switching it on and off I've extended theCSVRecordReadWriter
to be able to handle more than one possible length and switching between them seamlessly. And added toPgAuditRecord
theRows
field.So now the following Cluster:
Properly results in the following log:
And switching to
pgaudit.log_rows: "off"
results in still logs being parsed correctly: