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.


** Changed in: systemd (Ubuntu)
       Status: New => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1856330

Title:
  journalctl missing grep

Status in systemd package in Ubuntu:
  Fix Released
Status in systemd source package in Bionic:
  Won't Fix
Status in systemd source package in Disco:
  Won't Fix
Status in systemd source package in Eoan:
  Fix Released

Bug description:
  the man page for journalctl and the usage (journalctl --help)
  advertise an option (-g, --grep=) to grep the MESSAGE portion of
  events for a pcre pattern. journalctl is linked against libpcre, but
  doesn't recognize the option when used.

      $ journalctl -g dhcp
      journalctl: invalid option -- 'g'

  ProblemType: Bug
  DistroRelease: Ubuntu 18.04
  Package: systemd 237-3ubuntu10.33
  ProcVersionSignature: Ubuntu 
5.3.0-22.24+system76~1573660262~18.04~d11b582~dev-generic 5.3.7
  Uname: Linux 5.3.0-22-generic x86_64
  ApportVersion: 2.20.9-0ubuntu7.9
  Architecture: amd64
  CurrentDesktop: ubuntu:GNOME
  Date: Fri Dec 13 09:26:08 2019
  MachineType: System76, Inc. Wild Dog Performance
  ProcEnviron:
   TERM=xterm-256color
   PATH=(custom, no user)
   XDG_RUNTIME_DIR=<set>
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-5.3.0-22-generic 
root=UUID=25721613-9f9a-4e8d-ac61-a6869852d0e2 ro ipv6.disable=1 
usbhid.quirks=0x1B1C:0x1B13:0x400 quiet splash vt.handoff=1
  SourcePackage: systemd
  UpgradeStatus: Upgraded to bionic on 2018-10-05 (433 days ago)
  dmi.bios.date: 06/28/2013
  dmi.bios.vendor: American Megatrends Inc.
  dmi.bios.version: 0411
  dmi.board.asset.tag: To be filled by O.E.M.
  dmi.board.name: H87-PLUS
  dmi.board.vendor: ASUSTeK COMPUTER INC.
  dmi.board.version: Rev X.0x
  dmi.chassis.asset.tag: Asset-1234567890
  dmi.chassis.type: 3
  dmi.chassis.vendor: System76, Inc.
  dmi.chassis.version: Desktop
  dmi.modalias: 
dmi:bvnAmericanMegatrendsInc.:bvr0411:bd06/28/2013:svnSystem76,Inc.:pnWildDogPerformance:pvrwilp10:rvnASUSTeKCOMPUTERINC.:rnH87-PLUS:rvrRevX.0x:cvnSystem76,Inc.:ct3:cvrDesktop:
  dmi.product.family: ASUS MB
  dmi.product.name: Wild Dog Performance
  dmi.product.sku: All
  dmi.product.version: wilp10
  dmi.sys.vendor: System76, Inc.
  mtime.conffile..etc.systemd.resolved.conf: 2018-10-08T15:18:41.655856

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1856330/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to