unit.</para></listitem>
</varlistentry>
+ <varlistentry>
+ <term><option>--user-unit=</option></term>
+
+ <listitem><para>Show data only of the
+ specified user session unit. This will
+ add a match for
+ <literal>_SYSTEMD_USER_UNIT=</literal>
+ for the specified
+ unit.</para></listitem>
+ </varlistentry>
+
<varlistentry>
<term><option>-p</option></term>
<term><option>--priority=</option></term>
-h --help -l --local --new-id128 -m --merge --no-pager
--no-tail -q --quiet --setup-keys --this-boot --verify
--version --list-catalog --update-catalog'
- [ARG]='-D --directory -F --field -o --output -u --unit'
+ [ARG]='-D --directory -F --field -o --output -u --unit --user-unit'
[ARGUNKNOWN]='-c --cursor --interval -n --lines -p --priority --since --until
--verify-key'
)
--unit|-u)
comps=$(journalctl -F '_SYSTEMD_UNIT')
;;
+ --user-unit)
+ comps=$(journalctl -F '_SYSTEMD_USER_UNIT')
+ ;;
*)
return 0
;;
{-c,--cursor=}'[Start showing entries from specified cursor]:cursors:_journal_fields __CURSORS' \
{-b,--this-boot}'[Show data only from current boot]' \
{-u,--unit=}'[Show data only from the specified unit]:units:_journal_fields _SYSTEMD_UNIT' \
+ '--user-unit[Show data only from the specified user session unit]:units:_journal_fields _SYSTEMD_USER_UNIT' \
{-p,--priority=}'[Show only messages within the specified priority range]:priority:_journal_fields PRIORITY' \
{-f,--follow}'[Follow journal]' \
{-n,--lines=}'[Number of journal entries to show]:integer' \
static usec_t arg_since, arg_until;
static bool arg_since_set = false, arg_until_set = false;
static const char *arg_unit = NULL;
+static const char *arg_unit_type = NULL;
static const char *arg_field = NULL;
static bool arg_catalog = false;
static bool arg_reverse = false;
" -c --cursor=CURSOR Start showing entries from specified cursor\n"
" -b --this-boot Show data only from current boot\n"
" -u --unit=UNIT Show data only from the specified unit\n"
+ " --user-unit=UNIT Show data only from the specified user session unit\n"
" -p --priority=RANGE Show only messages within the specified priority range\n"
" -f --follow Follow journal\n"
" -n --lines[=INTEGER] Number of journal entries to show\n"
ARG_DISK_USAGE,
ARG_SINCE,
ARG_UNTIL,
+ ARG_USER_UNIT,
ARG_LIST_CATALOG,
ARG_UPDATE_CATALOG
};
{ "cursor", required_argument, NULL, 'c' },
{ "since", required_argument, NULL, ARG_SINCE },
{ "until", required_argument, NULL, ARG_UNTIL },
+ { "user-unit", required_argument, NULL, ARG_USER_UNIT },
{ "unit", required_argument, NULL, 'u' },
{ "field", required_argument, NULL, 'F' },
{ "catalog", no_argument, NULL, 'x' },
arg_until_set = true;
break;
+ case ARG_USER_UNIT:
+ arg_unit = optarg;
+ arg_unit_type = "_SYSTEMD_USER_UNIT=";
+ break;
+
case 'u':
arg_unit = optarg;
+ arg_unit_type = "_SYSTEMD_UNIT=";
break;
case '?':
if (!u)
return log_oom();
- m = strappend("_SYSTEMD_UNIT=", u);
+ m = strappend(arg_unit_type, u);
+
if (!m)
return log_oom();