mirror of
https://github.com/rsyslog/rsyslog.git
synced 2026-03-19 14:09:30 +01:00
Why: Commit 3ee31a8d0 added shared named ratelimit support (ratelimit.name + ratelimitNewFromConfig) but only wired it into imtcp, imptcp, and imudp. Seven modules with existing ratelimit.interval/ratelimit.burst support were left without the ability to reference shared ratelimit() objects. Impact: Adds ratelimit.name parameter to omfwd, omelasticsearch, omhttp, imhttp, imjournal, imklog, and imuxsock. Existing configurations remain unchanged. Before: These seven modules could only use inline ratelimit.interval/ratelimit.burst parameters. After: All modules can now reference shared ratelimit() configuration objects via ratelimit.name. Technical Overview: For each module, the same pattern from the imudp reference implementation is applied: - Add uchar *pszRatelimitName to config struct - Add ratelimit.name to cnfparamdescr - Change interval/burst defaults to -1 (sentinel) - Parse ratelimit.name in config handler - Add mutual-exclusivity check (name vs interval/burst) - Branch ratelimiter creation on pszRatelimitName: if set, call ratelimitNewFromConfig(); else legacy path - Free pszRatelimitName in destructor imuxsock is the most complex: it supports both per-socket ratelimit.name and syssock.ratelimit.name, with the per-source hashtable ratelimiter path also updated. imklog uses legacy parameter names (ratelimitinterval, ratelimitburst) but the new parameter uses the dotted form (ratelimit.name) for consistency. Each module receives a parameter doc page, module doc update, and a config-validation test. With the help of AI-Agents: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
27 lines
750 B
ReStructuredText
27 lines
750 B
ReStructuredText
.. index:: ! omfwd; RateLimit.Name
|
|
|
|
.. _param-omfwd-ratelimit-name:
|
|
|
|
RateLimit.Name
|
|
==============
|
|
|
|
.. summary-start
|
|
|
|
**Default:** none
|
|
|
|
**Type:** string
|
|
|
|
**Description:**
|
|
|
|
Sets the name of the rate limit to use. This allows multiple actions to share the same rate
|
|
limiting configuration (and state). The name refers to a :doc:`global rate limit object
|
|
<../../rainerscript/configuration_objects/ratelimit>` defined in the configuration.
|
|
|
|
**Note:** This parameter is mutually exclusive with ``ratelimit.interval`` and
|
|
``ratelimit.burst``. If ``ratelimit.name`` is specified, local per-action limits cannot be
|
|
defined and any attempt to do so will result in an error (and the named rate limit will be used).
|
|
|
|
.. versionadded:: 8.2602.0
|
|
|
|
.. summary-end
|