Description

Some repetitive log messages can be generated too often and there may be a need to throttle such messages but not filter them out completely.

This article explains how syslog messages can be throttled.

 

Symptoms

Some syslog messages are generated based on events coming from CPE devices. For example, a CPE device can behave incorrectly while sending packets, which may cause a syslog message to be generated. Such syslog messages can fill up the messages file on the router.

One possible solution for this is to filter such logs completely but in this case, the triggering condition such as the misbehaving CPE can be missed.

 

Solution

To throttle repetitive syslog messages, use the following configuration:

event-options {
    policy syslogThrottle1 {
        events system;
        within 60 {
            trigger after 1;
        }
        attributes-match {
            system.message matches "Part of the message which is present in all entries";
        }
        then {
            ignore;
        }
    }
}

With this configuration, there will be only one syslog message per minute, whereas the others will be ignored.

The configuration can be tested from shell ( start shell ) with the logger utility:

logger "example syslog message"