Comment 2 for bug 1856330

Revision history for this message
Dan Streetman (ddstreet) wrote :

Unfortunately, systemd in Bionic and Disco was built without the pcre2 library, and that's what journalctl uses to implement --grep. So before Eoan, journalctl --grep will fail with:

"Compiled without pattern matching support"

Since adding this support now would pull in an additional dependency to the systemd package, fixing this bug would mean breaking automatic updates for everyone using systemd (on Bionic or Disco) but without libpcre2 installed, since a package won't be automatically updated if it requires new dependencies that aren't currently installed.

Also unfortunately, the journalctl -g option was left out of the options string, so it prints "invalid option" as you mentioned; that is trivial to fix, but won't actually make journalctl grep work, since it would just change from "invalid option" to "compile without pattern matching support". So while the -g error message for journalctl in Bionic is a bit confusing, I don't think it's worth a patch just to slightly improve the error message without actually getting --grep working.

Please note that --grep (and -g) works starting in Eoan.

Also, I'll mention that you can still simply pipe journalctl output into the 'grep' tool; it's a bit less efficient but should still work.

Sorry.