Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: avoid conf of RatelimitBurst when RatelimitInterval is zero #373

Merged
merged 4 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions roles/rsyslog/templates/input_basics.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,21 @@ module(load="imklog" permitnonkernelfacility="on")
{% endif %}
{% if __rsyslog_input.use_imuxsock | d(false) | bool %}
module(load="imuxsock" # provides support for local system logging (e.g. via logger command)
SysSock.RateLimit.Interval="{{ __rsyslog_input.ratelimit_interval | d(0) }}"
{% if __rsyslog_input.ratelimit_interval | d(0) > 0 %}
SysSock.RateLimit.Burst="{{ __rsyslog_input.ratelimit_burst | d(200) }}"
SysSock.RateLimit.Interval="{{ __rsyslog_input.ratelimit_burst | d(0) }}"
{% endif %}
SysSock.Use="on") # Turn on message reception via local log socket.
input(name="basics_imuxsock" type="imuxsock" socket="/dev/log")
{% else %}
module(load="imuxsock" # provides support for local system logging (e.g. via logger command)
SysSock.Use="off") # Turn off message reception via local log socket.
module(load="imjournal"
StateFile="{{ __rsyslog_work_dir }}/imjournal.state"
RateLimit.Burst="{{ __rsyslog_input.ratelimit_burst | d(20000) }}"
RateLimit.Interval="{{ __rsyslog_input.ratelimit_interval | d(600) }}"
{% if __rsyslog_input.ratelimit_interval | d(0) > 0 %}
RateLimit.Burst="{{ __rsyslog_input.ratelimit_burst | d(20000) }}"
{% endif %}
PersistStateInterval="{{ __rsyslog_input.journal_persist_state_interval | d(10) }}")
{% endif %}
{{ lookup('template', 'input_template.j2') }}
4 changes: 3 additions & 1 deletion roles/rsyslog/templates/input_basics_rhel7.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ $OmitLocalLogging off
$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) }}
{% if __rsyslog_input.ratelimit_interval | d(0) > 0 %}
$imjournalRatelimitBurst {{ __rsyslog_input.ratelimit_burst | d(20000) }}
{% endif %}
$imjournalPersistStateInterval {{ __rsyslog_input.journal_persist_state_interval | d(10) }}

# Turn off message reception via local log socket;
Expand Down
Loading