Skip to content

When containers are sending their logs to journald, how to set journalmatch to a string instead of a service? #3704

Closed Answered by sebres
paulvirtuel asked this question in Q&A
Discussion options

You must be logged in to vote
  1. This doesn't have something with the MESSAGE - what you're seeing with container/postfix/smtp/smtpd[...] is called UNIT in journal fields. To check what exactly you can use, you need to inspect the output of journalctl -o json-pretty and then use it with journalmatch.
  2. Your approach can produce another issue with some filters, e. g. if the filter expect smtp/smtpd[...] but got container/postfix/smtp/smtpd[...] it would not match.
    So you have to filter by filter they still work, or to rewrite parts of them or overwrite certain parameters like _daemon, like here:
    _daemon = postfix(-\w+)?/[^/\[:\s]+(?:/smtp[ds])?

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@paulvirtuel
Comment options

@sebres
Comment options

@paulvirtuel
Comment options

@sebres
Comment options

Answer selected by sebres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants