summaryrefslogtreecommitdiff
path: root/src/journal-remote
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-07-23 20:22:30 +0200
committerLennart Poettering <lennart@poettering.net>2018-10-11 17:25:27 +0200
commit8e04444385ddf6cbf9e172cc63e59a351ad39d74 (patch)
tree075d5f322fae930c9a72aef73329ff91e80119b3 /src/journal-remote
parent02619c033fdeda7f5021364defd97c201ff9e7cd (diff)
downloadsystemd-8e04444385ddf6cbf9e172cc63e59a351ad39d74.tar.gz
journalctl: port JSON output mode to new JSON API
Also, while we are at it, beef it up, by adding json-seq support (i.e. https://tools.ietf.org/html/rfc7464). This is particularly useful in conjunction with jq's --seq switch.
Diffstat (limited to 'src/journal-remote')
-rw-r--r--src/journal-remote/journal-gatewayd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/journal-remote/journal-gatewayd.c b/src/journal-remote/journal-gatewayd.c
index 88e65ed905..a4e25f2284 100644
--- a/src/journal-remote/journal-gatewayd.c
+++ b/src/journal-remote/journal-gatewayd.c
@@ -58,6 +58,7 @@ static const char* const mime_types[_OUTPUT_MODE_MAX] = {
[OUTPUT_SHORT] = "text/plain",
[OUTPUT_JSON] = "application/json",
[OUTPUT_JSON_SSE] = "text/event-stream",
+ [OUTPUT_JSON_SEQ] = "application/json-seq",
[OUTPUT_EXPORT] = "application/vnd.fdo.journal",
};
@@ -267,6 +268,8 @@ static int request_parse_accept(
m->mode = OUTPUT_JSON;
else if (streq(header, mime_types[OUTPUT_JSON_SSE]))
m->mode = OUTPUT_JSON_SSE;
+ else if (streq(header, mime_types[OUTPUT_JSON_SEQ]))
+ m->mode = OUTPUT_JSON_SEQ;
else if (streq(header, mime_types[OUTPUT_EXPORT]))
m->mode = OUTPUT_EXPORT;
else