Bug 1267552 - systemd-journal-remote does not work as man page says
systemd-journal-remote does not work as man page says
Status: NEW
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: systemd-maint
Depends On:
  Show dependency treegraph
Reported: 2015-09-30 07:57 EDT by Branislav Blaškovič
Modified: 2017-09-27 23:40 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Branislav Blaškovič 2015-09-30 07:57:02 EDT
systemd-journal-remote has some issues.

Man page has an example:
    Copy local journal events to a different journal directory:
            journalctl -o export | systemd-journal-remote -o /tmp/dir -

    This does not work. First of all, binary systemd-journal-remote is not in default $PATH, but in /usr/lib/systemd/systemd-journal-remote.

    The second issue is that this example does not work:
        # journalctl -o export | /usr/lib/systemd/systemd-journal-remote -o /tmp/dir -
        For SplitMode=none, output must be a file.
    So I have to change it:
        # journalctl -o export | /usr/lib/systemd/systemd-journal-remote -o /tmp/dir/log.journal -
        Finishing after writing 1802 entries

Also if you don't read man page correctly and use file without .journal suffix, it returns really weird and missleading error:
    # journalctl -o export | /usr/lib/systemd/systemd-journal-remote -o /tmp/dir/log -
    Failed to open output journal /tmp/dir/log: Invalid argument
    Failed to get writer for source stdin: Invalid argument
    Failed to create source for fd:0 (stdin): Invalid argument

It would be nice to have working examples in man page and also some more readable error messages.

Version-Release number of selected component (if applicable):
Comment 2 Branislav Blaškovič 2015-10-01 09:45:50 EDT
Another issue.
I started gatewayd server and I can gather logs via curl.

But if I do it via systemd-journal-remote --url http://localhost:19531/ I just got:
  Spawning curl http://localhost:19531/entries?boot/entries...
  Failed to open output journal /var/log/journal/remote/remote-localhost:19531\x2fentries?boot.journal: No such file or directory
  Failed to get writer for source localhost:19531/entries?boot: No such file or directory
  Failed to create source for fd:7 (localhost:19531/entries?boot): No such file or directory

/var/log/journal is created.
I have to create /var/log/journal/remote to get it working which I don't understand. Man page says:

    Retrieve events from a remote systemd-journal-gatewayd(8) instance and store them in /var/log/journal/some.host/remote-some~host.journal:
           systemd-journal-remote --url http://some.host:19531/

So I suggest to change "some.host" to "remote". Maybe it would be cool if that tool creates the directory /var/log/journal/remote itself instead of that terrifying red error messages.

Note You need to log in before you can comment on or make changes to this bug.