Skip to content

Commit

Permalink
fix: event read from syslog
Browse files Browse the repository at this point in the history
When labes map is too big we may get syslog entry truncated.
This breaks JSON parsing making event loading impossible.

[NO NEW TESTS NEEDED]

Signed-off-by: Matej Vasek <mvasek@redhat.com>
  • Loading branch information
matejvasek committed Dec 7, 2022
1 parent 4096d04 commit bd33cc7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libpod/events/journal_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ func (e EventJournalD) Read(ctx context.Context, options ReadOptions) error {
logrus.Errorf("Unable to close journal :%v", err)
}
}()
err = j.SetDataThreshold(640 * (1 << 10))
if err != nil {
logrus.Warnf("cannot set data threshold: %v", err)
}
// match only podman journal entries
podmanJournal := sdjournal.Match{Field: "SYSLOG_IDENTIFIER", Value: "podman"}
if err := j.AddMatch(podmanJournal.String()); err != nil {
Expand Down

0 comments on commit bd33cc7

Please sign in to comment.