Most of the logic isn't journalctl specific, let's generalize a bit so we can reuse this for other commands as well.