{% if __rsyslog_input.kernel_message | d(false) | bool %}
module(load="imklog" permitnonkernelfacility="on")
{% endif %}
$ModLoad imuxsock # provides support for local system logging (e.g. via logger command)
{% if __rsyslog_input.use_imuxsock | d(false) | bool %}
# Turn on message reception via local log socket;
$OmitLocalLogging off
{% else %}
$ModLoad imjournal # provides access to the systemd journal
# File to store the position in the journal
$IMJournalStateFile imjournal.state
$imjournalRatelimitBurst {{ __rsyslog_input.ratelimit_burst | d(20000) }}
$imjournalRatelimitInterval {{ __rsyslog_input.ratelimit_interval | d(600) }}
$imjournalPersistStateInterval {{ __rsyslog_input.journal_persist_state_interval | d(10) }}

# Turn off message reception via local log socket;
# local messages are retrieved through imjournal now.
$OmitLocalLogging on

{% endif %}
{{ lookup('template', 'input_template.j2') }}
