1

I have a situation where it would be really useful to attach the relevant bits of the system logs to a bug ticket. The system in question uses journald and I rather like using journalctl to inspect the logs, so what I'd like to do is extract the relevant time span of the system logs into a file so I later can use journalctl --file=foo.journald to inspect. Something like:

journalctl  -S @1500253701 -U @1500256701 -o export > foo.journald

except of course that the export file format can't be read by journalctl.

Is this possible?

Magnus
  • 141
  • 5

1 Answers1

3

You can use systemd-journal-remote to convert like this

journalctl -S @1500253701 -U @1500256701 -o export > foo.export
systemd-journal-remote --output=foo.journald foo.export
journalctl --file=foo.journald

This information was added to the man page of journalctl in systemd 233, see commit.