How to use journalctl MESSAGE=?

I can use grep to find something in journal, but i would like to know how to use the build in search feature of journalctl.

Whats wrong with this example code?

Mai 23 22:30:46 manjaro systemd[857]: Starting Thumbnailing service...
Mai 23 22:30:46 manjaro tumblerd[493797]: Failed to load plugin "tumbler-gepub-thumbnailer.so": libgepub-0.7.so.0: Kann die Shared-Object-Datei nicht öffnen: Datei oder Verzeichnis nicht gefunden
Mai 23 22:30:46 manjaro dbus-daemon[885]: [session uid=1000 pid=885] Successfully activated service 'org.freedesktop.thumbnails.Thumbnailer1'

[manjaro john1]# journalctl MESSAGE="Starting"
-- No entries --

Even if i search for a single character i get “-- No entries --”

journalctl --version:

[manjaro john1]# journalctl --version
systemd 252 (252.10-2-manjaro)
+PAM +AUDIT -SELINUX -APPARMOR -IMA +SMACK +SECCOMP +GCRYPT +GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY +P11KIT -QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +BPF_FRAMEWORK +XKBCOMMON +UTMP -SYSVINIT default-hierarchy=unified

SysInfo:

Generated on 2023-05-30 15:25:1685453107

#################### inxi -Fxzc0 ########################

System:
  Kernel: 6.1.30-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 12.2.1 Desktop: Xfce v: 4.18.1
    Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Laptop System: LENOVO product: 81RS v: Lenovo Yoga S740-14IIL serial: <superuser required>
  Mobo: LENOVO model: LNVNB161216 v: SDK0J40709 WIN serial: <superuser required> UEFI: LENOVO
    v: BYCN39WW date: 05/28/2021
Battery:
  ID-1: BAT0 charge: 65.3 Wh (100.0%) condition: 65.3/62.0 Wh (105.3%) volts: 17.2 min: 15.4
    model: LGC L19L4PD2 status: full
CPU:
  Info: quad core model: Intel Core i7-1065G7 bits: 64 type: MT MCP arch: Ice Lake rev: 5 cache:
    L1: 320 KiB L2: 2 MiB L3: 8 MiB
  Speed (MHz): avg: 1418 high: 1500 min/max: 400/3900 cores: 1: 1500 2: 1200 3: 1500 4: 1500
    5: 1500 6: 1500 7: 1500 8: 1151 bogomips: 23968
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
  Device-1: Intel Iris Plus Graphics G7 vendor: Lenovo driver: i915 v: kernel arch: Gen-11
    bus-ID: 00:02.0
  Device-2: NVIDIA GP108M [GeForce MX250] vendor: Lenovo driver: nvidia v: 530.41.03 arch: Pascal
    bus-ID: 2b:00.0
  Device-3: Chicony Integrated Camera driver: uvcvideo type: USB bus-ID: 3-5:5
  Display: x11 server: X.Org v: 21.1.8 driver: X: loaded: modesetting,nvidia unloaded: nouveau
    dri: iris gpu: i915 resolution: 1: 1920x1080~60Hz 2: N/A
  API: OpenGL v: 4.6 Mesa 23.0.3 renderer: Mesa Intel Iris Plus Graphics (ICL GT2)
    direct-render: Yes
Audio:
  Device-1: Intel Ice Lake-LP Smart Sound Audio vendor: Lenovo driver: sof-audio-pci-intel-icl
    bus-ID: 00:1f.3
  API: ALSA v: k6.1.30-1-MANJARO status: kernel-api
  Server-1: sndiod v: N/A status: off
  Server-2: PipeWire v: 0.3.70 status: active
Network:
  Device-1: Intel Ice Lake-LP PCH CNVi WiFi driver: iwlwifi v: kernel bus-ID: 00:14.3
  IF: wlp0s20f3 state: up mac: <filter>
  Device-2: Realtek RTL8153 Gigabit Ethernet Adapter driver: r8152 type: USB bus-ID: 2-1.4:4
  IF: enp0s13f0u1u4 state: up speed: 1000 Mbps duplex: full mac: <filter>
  IF-ID-1: pan1 state: down mac: <filter>
Bluetooth:
  Device-1: Intel AX201 Bluetooth driver: btusb v: 0.8 type: USB bus-ID: 3-10:8
  Report: rfkill ID: hci0 rfk-id: 2 state: up address: see --recommends
Drives:
  Local Storage: total: 1.86 TiB used: 435.58 GiB (22.9%)
  ID-1: /dev/nvme0n1 vendor: Micron model: MTFDHBA1T0TCK size: 953.87 GiB temp: 51.9 C
  ID-2: /dev/sda vendor: Western Digital model: WD10EARX-00N0YB0 size: 931.51 GiB type: USB
  ID-3: /dev/sdb vendor: Kingston model: DataTraveler 2.0 size: 14.54 GiB type: USB
Partition:
  ID-1: / size: 57.85 GiB used: 40.95 GiB (70.8%) fs: ext4 dev: /dev/nvme0n1p8
  ID-2: /boot/efi size: 259.5 MiB used: 114.8 MiB (44.2%) fs: vfat dev: /dev/nvme0n1p1
Swap:
  ID-1: swap-1 type: partition size: 16.67 GiB used: 0 KiB (0.0%) dev: /dev/nvme0n1p9
Sensors:
  System Temperatures: cpu: 45.0 C mobo: N/A
  Fan Speeds (RPM): N/A
Info:
  Processes: 284 Uptime: 22h 25m Memory: available: 15.19 GiB used: 3.47 GiB (22.9%) Init: systemd
  Compilers: gcc: 12.2.1 clang: 15.0.7 Packages: 1994 Client: Unknown Client: wrapper-2.0
  inxi: 3.3.27

Tipps are welcome

Hi @JohnML,

That is the expected behaviour. On my PC it is the same:

$ journalctl MESSAGE='i'
-- No entries --

I suspect what you’re looking for is the --grep= argument:

$ journalctl --grep='start'                                                                                                                                                                                                                        [...]
Dec 02 16:42:42 Mirdarthos-PC systemd[1]: Started Session 1483 of User mirdarthos.
Dec 02 16:43:11 Mirdarthos-PC systemd[1]: Started Session 1484 of User mirdarthos.
[...]

Hope it helps!

1 Like

It needs to be specific and match completely. Try:

journalctl MESSAGE="Starting Thumbnailing service..."

or

journalctl MESSAGE="Reached target Local File Systems."

It is not for searching in a single field.

1 Like

I got the answer from google chrome extension ChatGPT

Result: don’t trust ChatGPT ?!!

Quote from ChatGPT:

journalctl MESSAGE="error"
This command will display all the log entries that contain the word "error" in their message field.


Note that the actual behavior and output may vary depending on your Linux distribution and the version of systemd in use.

man journalctl tells me:

-g, --grep=
           Filter output to entries where the MESSAGE= field matches the
           specified regular expression. PERL-compatible regular
           expressions are used, see pcre2pattern(3) for a detailed
           description of the syntax.

So @Mirdarthos is correct: i had to use --grep=“Starting”

Yes the grep option can be used for searching in the message field. It is similar to the normal grep command, just for the journal.

Tole ya!

Hihi, my ChatGPT answer for “Tole ya!” is

Sijui maana kamili ya "Tole ya!" Kwa bahati mbaya, hakuna habari yoyote juu ya maneno hayo katika mazingira yangu ya sasa ya taarifa. Je, unaweza kuelezea zaidi maana au matumizi yake ili niweze kukusaidia?

Google translate tells me thats swahili

I don't know the exact meaning of "Tole ya!" Unfortunately, there is no information about those words in my current information environment. Can you explain more about its meaning or usage so I can help you?

I think i remove that extension now, next to useless !

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.