How do i display systemd journal log entries by priority using journalctl?



  • Man page for journalctl.

           -b [ID][±offset], --boot=[ID][±offset]
               Show messages from a specific boot. This will add a match for "_BOOT_ID=".
    
               The argument may be empty, in which case logs for the current boot will be shown.
    
               If the boot ID is omitted, a positive offset will look up the boots starting from the
               beginning of the journal, and a equal-or-less-than zero offset will look up boots starting
               from the end of the journal. Thus, 1 means the first boot found in the journal in
               chronological order, 2 the second and so on; while -0 is the last boot, -1 the boot before
               last, and so on. An empty offset is equivalent to specifying -0, except when the current
               boot is not the last boot (e.g. because --directory was specified to look at logs from a
               different machine).
    
               If the 32-character ID is specified, it may optionally be followed by offset which
               identifies the boot relative to the one given by boot ID. Negative values mean earlier
               boots and a positive values mean later boots. If offset is not specified, a value of zero
               is assumed, and the logs for the boot given by ID are shown.
    
           -p, --priority=
               Filter output by message priorities or priority ranges. Takes either a single numeric or
               textual log level (i.e. between 0/"emerg" and 7/"debug"), or a range of numeric/text log
               levels in the form FROM..TO. The log levels are the usual syslog log levels as documented
               in syslog(3), i.e.  "emerg" (0), "alert" (1), "crit" (2), "err" (3), "warning" (4),
               "notice" (5), "info" (6), "debug" (7). If a single log level is specified, all messages
               with this log level or a lower (hence more important) log level are shown. If a range is
               specified, all messages within the range are shown, including both the start and the end
               value of the range. This will add "PRIORITY=" matches for the specified priorities.
    

    Display entries from current journal that have priority of err.

    $ journalctl -b  -p "err"
    -- Logs begin at Sun 2019-02-03 11:15:35 UTC, end at Sun 2019-02-03 13:45:36 UTC. --
    Feb 03 11:15:36 training1 kernel: piix4_smbus 0000:00:01.3: SMBus base address uninitialized
    Feb 03 11:16:32 training1 systemd[1]: Failed to start Crash recovery k
    

    These are the syslog or logger priorities.


 

© Lightnetics 2019