I expect "-b" to never output entries that don't belong to the current boot, but when there are explicit disjunctions in the match expression, it gets confused. This is correct: # journalctl -b -o verbose | grep _BOOT_ID | sort | uniq _BOOT_ID=e2e2a996e7da4fb28d56f12a9c8a5261 (only one boot id) but this isn't: # journalctl -b -o verbose _PID=2 + _PID=1 | grep _BOOT_ID | sort | uniq _BOOT_ID=1e128df28b734458a797870d84a806ee _BOOT_ID=361717ded01e4a3d896f52f3bbd9cde7 _BOOT_ID=6805fcfa65334dd188c78e54962c2f2e _BOOT_ID=7af680e2259a4af0b81a948950d3046b _BOOT_ID=91283683ba8b4164b8bde31498f85d4e _BOOT_ID=e2e2a996e7da4fb28d56f12a9c8a5261 (many boot ids) I guess this happens because "-b" just adds a single "_BOOT_ID=..." match which results in an effective match expression of (_BOOT_ID=... && _PID=2) || (_PID=1) in the last case. To fix this, the _BOOT_ID_... match needs to _also_ be added after each call to sd_journal_add_disjunction, I think. Patch with pleasure on request.
(The "-p" option might have the same problem.)
Created attachment 77624 [details] [review] Possible fix Here is a quick patch. I haven't tested this much, but it does help with the example in this bug report.
a better fix: http://lists.freedesktop.org/archives/systemd-devel/2013-April/010360.html http://lists.freedesktop.org/archives/systemd-devel/2013-April/010361.html http://lists.freedesktop.org/archives/systemd-devel/2013-April/010362.html
Fixed in git.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.