mirror of
https://github.com/roddhjav/apparmor.d.git
synced 2024-11-14 23:43:56 +01:00
feat(aa-log): improve the journalctl filter.
This commit is contained in:
parent
9c0f4dd6a7
commit
b636b4b3e9
@ -75,8 +75,13 @@ func GetJournalctlLogs(path string, useFile bool) (io.Reader, error) {
|
||||
}
|
||||
scanner = bufio.NewScanner(file)
|
||||
} else {
|
||||
// journalctl -b -o json --grep=apparmor --output-fields=MESSAGE > systemd.log
|
||||
cmd := exec.Command("journalctl", "--boot", "--grep=apparmor", "--output=json", "--output-fields=MESSAGE")
|
||||
// journalctl -b -o json -g apparmor -t kernel -t audit -t dbus-daemon --output-fields=MESSAGE > systemd.log
|
||||
args := []string{
|
||||
"--boot", "--grep=apparmor",
|
||||
"--identifier=kernel", "--identifier=audit", "--identifier=dbus-daemon",
|
||||
"--output=json", "--output-fields=MESSAGE",
|
||||
}
|
||||
cmd := exec.Command("journalctl", args...)
|
||||
cmd.Stdout = &stdout
|
||||
if err := cmd.Run(); err != nil {
|
||||
return nil, err
|
||||
|
Loading…
Reference in New Issue
Block a user