How to customize rsyslog messages with metadata extracted from systemd-journald

Solution Verified - Updated -

Issue

  • I want to add systemd-journald fields, e.g. _MACHINE_ID to messages in /var/log/messages

    • standard /var/log/messages
    Nov 14 16:40:28 mysystem systemd-logind: New session 3 of user root.
    
    • new /var/log/messages with _MACHINE_ID field between > and <
    Nov 14 16:41:18 mysystem >1de921fc75524ff0bb4386b99ca4a3ff< systemd-logind: Starting Session 4 of user root.
    

Environment

  • Red Hat Enterprise Linux (RHEL) 7 and later
  • rsyslog
  • systemd-journald

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content