systemdユニットを指定せずにutil-linuxを使用したロギング

systemdユニットを指定せずにutil-linuxを使用したロギング

次のようにutil-linuxロガーを使用してログインする場合:

/bin/logger "hello world"

Journalctlで私のログ行を見ることができます。

journalctl --since "-1m"
Oct 08 09:12:17 myhomepc duda[11670]: hello world

しかし、フィルタリングに使用できるデフォルトの疑似単位ファイルは何ですか?

journalctl -u "duda" --since "-1m" 

何も返しません。

ベストアンサー1

journalctl -t duda --since "-1m"動作する必要があります。

loggersyslog(3) syslog モジュールとインタフェースし、対応する SYSLOG_IDENTIFIER( -t/ --tag) を使用して syslog にエントリを作成します。 manを参照してください。ロガー(1)

-t, --tag tag
    Mark every line to be logged with the specified tag. The
    default tag is the name of the user logged in on the terminal
    (or a user name based on effective user ID).

journalctl指定された SYSLOG_IDENTIFIER を個人別にフィルタリングできるようにするログ制御(1)

-t, --identifier=SYSLOG_IDENTIFIER|PATTERN
    Show messages for the specified syslog identifier SYSLOG_IDENTIFIER, or for any of the messages with a
    "SYSLOG_IDENTIFIER" matched by PATTERN.

おすすめ記事