fix: event read from syslog

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>
This commit is contained in:
Matej Vasek 2022-12-07 21:28:27 +01:00
parent 4096d04123
commit 04ea8eadea
1 changed files with 4 additions and 0 deletions

View File

@ -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(0)
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 {