rate-limit()
Synopsis: | rate-limit(key($HOST) rate(5000)) |
Description: Limits messages rate based on arbitrary keys in each message. The key will be resolved using the key()
option. Each resolution will be allowed to have the number of messages each second, set by the rate()
option. For example if key($HOST)
and rate(5000)
are set, and there are 2 hosts sending messages to AxoSyslog, a total of 10000
messages will be allowed by the rate-limit()
filter, 5000
from the first and 5000
from the second host. If key()
was not set instead, then 5000
messages would be allowed each second, regardless of their content.
Note
In AxoSyslog version 3.35 the
rate-limit()
filter was called throttle()
. In AxoSyslog version 3.36 it got renamed to rate-limit()
, but throttle()
is still available for backward compatibility.
Note
Like every other filter, messages unmatched (outside of the rate limit) by the
rate-limit()
filter are dropped by default. Also, as every filter can be used in channels or if conditions, the messages unmatched can be caught and handled, like sent to a different destination, and so on.
Example: Using the rate-limit() filter
The following example depicts the scenario described in the description part of this section.
filter f_rate_limit {
rate-limit(
key("$HOST")
rate(5000)
);
};
Last modified December 18, 2024: Merge pull request #90 from axoflow/minor-fixes-241218 (68cd7df)