I have one systemd service which runs with systemctl --user start test_unit@random_arguments
. How could I use journalctl
to filter all logs of test_unit
? If it supports "follow mode", that's even better.
1 Answer
If this is a user unit, use the --user-unit
option:
journalctl -f --user-unit=test_unit@random_arguments
Otherwise, filter the unit with _SYSTEMD_UNIT
:
sudo journalctl -f _SYSTEMD_UNIT=test_unit@random_arguments
-
Thanks. The
--user
option saves my day.journalctl --user -u test_unit@* -f
works Apr 3, 2019 at 11:06 -
1