Surely there's a way to ask journalctl to give me just a timestamp and
message?
No. As of now (November 2023) there's no way to have journalctl print just the time and the message without post-processing.
The closest to what you want is
journalctl --no-hostname -o short-full
which will give you DATE TIME PROCESS: MESSAGE
If that's not good enough for you then your only option is to use other tools to extract / format that data.
With journalctl you could use one of json or export output modes, extract only the timestamp and message (and convert the timestamp to time only) - like user deanresin shows here via jq.
You could also use one of the systemd bindings available and write your own tool to get that data, as suggested by user Maximko in comments (e.g. python systemd.journal)
Finally, if you wanted to display the messages in real time, you could use journalctl in follow mode and prepend a timestamp each time a line is printed e.g. with ts from moreutils:
journalctl -f -o cat | ts '%H:%M:%S'
Now, as to why --output-fields=__REALTIME_TIMESTAMP,MESSAGE doesn't print only those two fields...
The current manual page for journalctl, section "Output Options" states:
--output-fields=
A comma separated list of the fields which should be included in the output. This has an effect only for the output
modes which would normally show all fields (verbose, export, json,
json-pretty, json-sse and json-seq), as well as on cat. For the
former, the "__CURSOR", "__REALTIME_TIMESTAMP",
"__MONOTONIC_TIMESTAMP", and "_BOOT_ID" fields are always printed.
--output-fields was added in version 236, however support for filtering fields when using -o cat was only added later, in version 246:
journalctl's "-o cat" output mode will now show one or more journal
fields specified with --output-fields= instead of unconditionally
MESSAGE=. This is useful to retrieve a very specific set of fields
without any decoration.
Based on the above, those four fields are always printed except when using -o cat. One would think that
journalctl -o cat --output-fields=__REALTIME_TIMESTAMP,MESSAGE
should work... but that prints
Failed to get data: Invalid argument
Why is that?
The journal fields are described in the man page systemd.journal-fields. There are three timestamp fields for messages: _SOURCE_REALTIME_TIMESTAMP,__REALTIME_TIMESTAMP and __MONOTONIC_TIMESTAMP (note that the last two start with two underscores). All of them are in microseconds, formatted as decimal strings so none of them meets your requirement (HH:MM:SS format). Furthermore, per the same man page, the last two timestamps are special addressing fields (they cannot be used as matches by which to filter the entries):
During serialization into external formats, such as the Journal Export
Format or the Journal JSON Format, the addresses of journal entries
are serialized into fields prefixed with double underscores. Note that
these are not proper fields when stored in the journal but for
addressing metadata of entries. They cannot be written as part of
structured log entries via calls such as sd_journal_send(3). They may
also not be used as matches for sd_journal_add_match(3).
The last sentence points to sd_journal_add_match(3) man page which states:
sd_journal_add_match() adds a match by which to filter the entries
of the journal file. Matches applied with this call will filter what
can be iterated through and read from the journal file via calls like
sd_journal_next(3) and sd_journal_get_data(3). Parameter data must
be of the form "FIELD=value", where the FIELD part is a short
uppercase string consisting only of 0–9, A–Z and the underscore; it
may not begin with two underscores or be the empty string.
hence the error: __REALTIME_TIMESTAMP is not a valid field name for sd_journal_get_data(3).
To sum up: the only timestamp that --output-fields accepts when used together with -o cat is _SOURCE_REALTIME_TIMESTAMP and even then, the output is pretty far from what you want e.g.
journalctl -o cat --output-fields=_SOURCE_REALTIME_TIMESTAMP,MESSAGE
prints
1699815974366491
Supervising 9 threads of 6 processes of 1 users.
1699815968034836
[system] Successfully activated service 'org.kde.powerdevil.backlighthelper'
--output-fieldsoption is just ignored. Have you solved the issue?--output="json" --output-fields="MESSAGE", i.e. specifyingoutputexplicitly? It works for me where without,--output-fieldsis indeed ignored. The docs read: Select fields to print in verbose/export/json modes. The default is short, so it doesn't work there.