omjournal: Systemd Journal Output — rsyslog 8.2102.0 documentation

# omjournal: Systemd Journal Output

Module Name: | omjournal
Author: | Rainer Gerhards <rgerhards@adiscon.com>

## Purpose

This module provides native support for logging to the systemd journal.

## Configuration Parameters

Note

Parameter names are case-insensitive.

### Action Parameters

#### Template

type | default | mandatory | `obsolete legacy` directive
--- | --- | --- | ---
word | none | no | none

Template to use when submitting messages.

By default, rsyslog will use the incoming %msg% as the MESSAGE field of the journald entry, and include the syslog tag and priority.

You can override the default formatting of the message, and include custom fields with a template. Complex fields in the template (eg. json entries) will be added to the journal as json text. Other fields will be coerced to strings.

Journald requires that you include a template parameter named MESSAGE.

## Examples

### Example 1

The following sample writes all syslog messages to the journal with a custom EVENT_TYPE field.

    module(load="omjournal")

    template(name="journal" type="list") {
      constant(value="Something happened" outname="MESSAGE")
      property(name="$!event-type" outname="EVENT_TYPE")
    }

    action(type="omjournal" template="journal")

See also

Help with configuring/using `Rsyslog`:

- Mailing list - best route for general questions
- GitHub: rsyslog source project - detailed questions, reporting issues that are believed to be bugs with `Rsyslog`
- Stack Exchange (View, Ask) - experimental support from rsyslog community

See also

Contributing to `Rsyslog`:

- Source project: rsyslog project README.
- Documentation: rsyslog-doc project README

Copyright 2008-2020 Rainer Gerhards (Großrinderfeld), and Others.