0

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 1

1

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
2
  • Thanks. The --user option saves my day. journalctl --user -u test_unit@* -f works
    – Guisong He
    Apr 3, 2019 at 11:06
  • 1
    Right, --user-unit combines --user and -u ;-). Apr 3, 2019 at 11:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .