summaryrefslogtreecommitdiff
path: root/src/journal
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-10-11 02:37:10 +0200
committerLennart Poettering <lennart@poettering.net>2012-10-11 02:37:10 +0200
commit48383c251185c4596e9098878b28334c69e7bfd9 (patch)
tree008dbe8d4d7f87520b839e0f63e34d7190daca2d /src/journal
parent33316dbf20d378e15d126d97d0415407853a7fb8 (diff)
journal: support epxorting the journal in a format suitable for text/event-stream
Diffstat (limited to 'src/journal')
-rw-r--r--src/journal/journal-gatewayd.c5
-rw-r--r--src/journal/journalctl.c2
2 files changed, 5 insertions, 2 deletions
diff --git a/src/journal/journal-gatewayd.c b/src/journal/journal-gatewayd.c
index 33dda266b6..b2d4abf4fe 100644
--- a/src/journal/journal-gatewayd.c
+++ b/src/journal/journal-gatewayd.c
@@ -55,7 +55,8 @@ typedef struct RequestMeta {
static const char* const mime_types[_OUTPUT_MODE_MAX] = {
[OUTPUT_SHORT] = "text/plain",
[OUTPUT_JSON] = "application/json",
- [OUTPUT_EXPORT] = "application/vnd.fdo.journal"
+ [OUTPUT_JSON_SSE] = "text/event-stream",
+ [OUTPUT_EXPORT] = "application/vnd.fdo.journal",
};
static RequestMeta *request_meta(void **connection_cls) {
@@ -286,6 +287,8 @@ static int request_parse_accept(
if (streq(accept, mime_types[OUTPUT_JSON]))
m->mode = OUTPUT_JSON;
+ else if (streq(accept, mime_types[OUTPUT_JSON_SSE]))
+ m->mode = OUTPUT_JSON_SSE;
else if (streq(accept, mime_types[OUTPUT_EXPORT]))
m->mode = OUTPUT_EXPORT;
else
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index ec05c160be..04cebff547 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -93,7 +93,7 @@ static int help(void) {
" -n --lines[=INTEGER] Number of journal entries to show\n"
" --no-tail Show all lines, even in follow mode\n"
" -o --output=STRING Change journal output mode (short, short-monotonic,\n"
- " verbose, export, json, json-pretty, cat)\n"
+ " verbose, export, json, json-pretty, json-sse, cat)\n"
" -q --quiet Don't show privilege warning\n"
" -m --merge Show entries from all available journals\n"
" -b --this-boot Show data only from current boot\n"