fix(aa-log): grep journal logs over apparmor instead of AVC for wider compatibility.

This commit is contained in:
Alexandre Pujol 2024-05-03 12:34:08 +01:00
parent dfdf50a3d3
commit 9c0f4dd6a7
No known key found for this signature in database
GPG Key ID: C5469996F0DF68EC

View File

@ -75,8 +75,8 @@ func GetJournalctlLogs(path string, useFile bool) (io.Reader, error) {
} }
scanner = bufio.NewScanner(file) scanner = bufio.NewScanner(file)
} else { } else {
// journalctl -b -o json --grep=AVC --output-fields=MESSAGE > systemd.log // journalctl -b -o json --grep=apparmor --output-fields=MESSAGE > systemd.log
cmd := exec.Command("journalctl", "--boot", "--grep=AVC", "--output=json", "--output-fields=MESSAGE") cmd := exec.Command("journalctl", "--boot", "--grep=apparmor", "--output=json", "--output-fields=MESSAGE")
cmd.Stdout = &stdout cmd.Stdout = &stdout
if err := cmd.Run(); err != nil { if err := cmd.Run(); err != nil {
return nil, err return nil, err