diff options
Diffstat (limited to 'src/journal/journalctl.c')
-rw-r--r-- | src/journal/journalctl.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index a6b6e0fbd6..3475b9d43c 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -31,7 +31,7 @@ #include "log.h" int main(int argc, char *argv[]) { - int r; + int r, i; sd_journal *j = NULL; log_set_max_level(LOG_DEBUG); @@ -46,6 +46,14 @@ int main(int argc, char *argv[]) { goto finish; } + for (i = 1; i < argc; i++) { + r = sd_journal_add_match(j, argv[i], strlen(argv[i])); + if (r < 0) { + log_error("Failed to add match: %s", strerror(-r)); + goto finish; + } + } + SD_JOURNAL_FOREACH(j) { const void *data; size_t length; |