9

journalctl -u ssh prints all records associated with the ssh unit. But how can I get all records not associated with the ssh unit? Things that don't work: journalctl -u '!ssh'; journalctl '!_SYSTEMD_UNIT=ssh'; journalctl '_SYSTEMD_UNIT!=ssh'. Documentation doesn't suggest that this is possible, but I'm still hopeful. ;-)

smammy
  • 502

1 Answers1

1

The -T/--exclude-identifier option was added in systemd 256 which can filter out units. To filter out ssh:

journalctl --exclude-identifier ssh

This is what the journalctl man page says about it

   -T, --exclude-identifier=SYSLOG_IDENTIFIER
      Exclude messages for the specified syslog identifier
      SYSLOG_IDENTIFIER.
  This parameter can be specified multiple times.

  Added in version 256.