rsyslog/doc/source/reference/parameters/imuxsock-ratelimit-name.rst
Rainer Gerhards c0e99a1e40
ratelimit: wire ratelimit.name into remaining modules
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>
2026-02-26 15:52:46 +01:00

27 lines
772 B
ReStructuredText

.. index:: ! imuxsock; RateLimit.Name
.. _param-imuxsock-ratelimit-name:
RateLimit.Name
==============
.. summary-start
**Default:** none
**Type:** string
**Description:**
Sets the name of the rate limit to use for this socket. This allows multiple sockets 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-socket 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