zpcimon: Allow setting output format and use JSON Lines in systemd unit

Introduce separate '--format' option to set output format. Use the new
JSON Lines format explicitly in the systemd unit. Since JSON Lines
format only uses printable characters this removes the need for passing
'-a' to systemctl status. At the same time JSON-SEQ is more easily
parsable using 'jq --seq' so keep it the default for easier scripting.

Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Niklas Schnelle
2026-06-17 21:48:47 +02:00
committed by Jan Höppner
parent 8a4a4e0557
commit 2c63c69af4
4 changed files with 59 additions and 3 deletions

View File

@@ -84,6 +84,14 @@ on".
.PP
.PP
.
.SS Output Format Options
.OD format "" <FORMAT>
Set the output format out of json, json-seq, jsonl, pairs, and csv. Note that
only json-seq and jsonl sequence formats are supported for monitoring mode as
they handle a continuous stream of updates well. While they are not supported
in query mode.
.PP
.
.SS General Options
.OD help "h" ""
Print usage information, then exit.