From the man page for systemd-journal-remote: EXAMPLES Copy local journal events to a different journal directory: journalctl -o export | systemd-journal-remote -o /tmp/dir - Results below: jharvell@wolfhound tmp$ mkdir testdir jharvell@wolfhound tmp$ journalctl -o export | /usr/lib/systemd/systemd-journal-remote -o testdir - For SplitMode=none, output must be a file. jharvell@wolfhound tmp$ ls -l testfile -rw-r--r-- 1 jharvell cta 0 Jun 14 09:31 testfile jharvell@wolfhound tmp$ rm testfile jharvell@wolfhound tmp$ journalctl -o export | /usr/lib/systemd/systemd-journal-remote -o testfile - Failed to open output journal testfile: Invalid argument Failed to get writer for source stdin: Invalid argument Failed to create source for fd:0 (stdin): Invalid argument jharvell@wolfhound tmp$ ls -l testfile ls: cannot access 'testfile': No such file or directory jharvell@wolfhound tmp$ touch testfile jharvell@wolfhound tmp$ journalctl -o export | /usr/lib/systemd/systemd-journal-remote -o testfile - Failed to open output journal testfile: Invalid argument Failed to get writer for source stdin: Invalid argument Failed to create source for fd:0 (stdin): Invalid argument jharvell@wolfhound tmp$ journalctl -o export | /usr/lib/systemd/systemd-journal-remote --split-mode=host -o testdir - For SplitMode=none, output must be a file. Actually, what I am trying to do is export a subset of logs (from a time range) and save them back in the original journal file format so I can use journalctl on that filtered subset of logs. So my case differs from the example only in that I would have filtering options on the journalctl command and would want to output to a single file instead of a directory. But in any case, systemd-journal-remote seems to be broken wrt to reading a stream from stdin. I also have some feedback about the Gentoo packaging of this tool: * I had to use trial and error to figure out that it is the http use flag than causes systemd-journal-remote to be installed. This is not obvious and should be documented. * For the use case documented in the man page, this program would be executed from a shell. So it should be in my PATH (e.g., /usr/bin) instead of /usr/lib/systemd/systemd-journal-remote
Created attachment 476336 [details] output of emerge --info
Please report the problem upstream; this is nothing Gentoo-related. > I had to use trial and error to figure out that it is the http use flag than causes systemd-journal-remote to be installed. This is not obvious and should be documented. Upstream is pretty terrible at naming/documenting their configure flags as well. If you can provide a suggested change for metadata.xml, I'm happy to commit it. > For the use case documented in the man page, this program would be executed from a shell. So it should be in my PATH (e.g., /usr/bin) instead of /usr/lib/systemd/systemd-journal-remote Also an upstream issue.