Discussion:
journalctl --unit and pattern
(too old to reply)
Cecil Westerhof
2017-12-18 17:01:21 UTC
Permalink
At the moment I am using:
journalctl --boot --follow --no-tail --unit storeSystemStatistics
--unit vmstatLog

But instead of unit names you should be able to use a pattern. I tried the
following:
--unit "storeSystemStatistics|vmstatLog"

​And variants on it, but could not make it work.

How should I use a pattern. (I could not find info about it.)​
--
Cecil Westerhof
Tomasz Torcz 👁️
2017-12-18 19:31:41 UTC
Permalink
Post by Cecil Westerhof
journalctl --boot --follow --no-tail --unit storeSystemStatistics
--unit vmstatLog
But instead of unit names you should be able to use a pattern. I tried the
--unit "storeSystemStatistics|vmstatLog"
​And variants on it, but could not make it work.
How should I use a pattern. (I could not find info about it.)​
You can pass multiple --unit parameters:
journalctl --unit storeSystemStatistics --unit vmstatLog
--
Tomasz Torcz There exists no separation between gods and men:
xmpp: ***@chrome.pl one blends softly casual into the other.
Kai Krakow
2017-12-18 21:53:29 UTC
Permalink
Post by Cecil Westerhof
journalctl --boot --follow --no-tail --unit storeSystemStatistics
--unit vmstatLog
But instead of unit names you should be able to use a pattern. I tried the
--unit "storeSystemStatistics|vmstatLog"
​And variants on it, but could not make it work.
How should I use a pattern. (I could not find info about it.)​
You can exploit bash expansion for that:

$ journalctl --boot --follow --notail --unit={storeSystemStatistics,vmstatLog}

Note the equal sign...

The curly braces will the be expanded into two separate unit parameters
before being passed to the journalctl command.
--
Regards,
Kai

Replies to list-only preferred.
Cecil Westerhof
2017-12-18 23:00:35 UTC
Permalink
Post by Kai Krakow
Post by Cecil Westerhof
journalctl --boot --follow --no-tail --unit storeSystemStatistics
--unit vmstatLog
But instead of unit names you should be able to use a pattern. I tried
the
Post by Cecil Westerhof
--unit "storeSystemStatistics|vmstatLog"
​And variants on it, but could not make it work.
How should I use a pattern. (I could not find info about it.)​
$ journalctl --boot --follow --notail --unit={storeSystemStatistics,
vmstatLog}
Note the equal sign...
The curly braces will the be expanded into two separate unit parameters
before being passed to the journalctl command.
​Works like a charm. Thanks.
--
Cecil Westerhof
Loading...