Atualmente, o journalctl não suporta padrões ou curingas em correspondências de campo. grep é sua melhor opção.
Eu tive o mesmo problema e acho que journalctl só procura uma correspondência exata para VALUE quando NAME=VALUE é passado como argumentos.
Minhas investigações:
-
página de manual
De
journalctl(1)O padrão não é mencionado na descrição das correspondências:
[...] A match is in the format "FIELD=VALUE", e.g. "_SYSTEMD_UNIT=httpd.service", referring to the components of a structured journal entry. [...]A página man se refere a um padrão ao descrever apenas a opção
-u.-u, --unit=UNIT|PATTERN Show messages for the specified systemd unit UNIT (such as a service unit), or for any of the units matched by PATTERN. -
Código-fonte
A função
fnmatchinsrc/journalé usado ao pesquisar apenas unidades . -
debug journalctl
Ativando a saída de depuração, você pode ver que o padrão é expandido somente quando usar
-u.$ SYSTEMD_LOG_LEVEL=debug journalctl -n1 -u gdm* ... Matched gdm.service with pattern _SYSTEMD_UNIT=gdm* Matched gdm.service with pattern UNIT=gdm* Journal filter: ((OBJECT_SYSTEMD_UNIT=gdm.service AND _UID=0) OR (UNIT=gdm.service AND _PID=1) OR (COREDUMP_UNIT=gdm.service AND _UID=0 AND MESSAGE_ID=fc2e22bc6ee647b6b90729ab34a250b1) OR _SYSTEMD_UNIT=gdm.service) ...Todas as correspondências são tratadas como exatas, incluindo
UNIT:$ SYSTEMD_LOG_LEVEL=debug journalctl -n1 UNIT=gdm.* ... Journal filter: UNIT=gdm* ...