20.4. Filtering Log Messages

It is possible to specify filters which decide which messages are sent to a log receiver. This can be done in either or both the following ways:

These methods are described next.

Filtering on Log Severity

The optional LogSeverity property of a log receiver object can be used to specify what severities are sent to the receiver. By default, all log messages except those with the Debug severity are sent. However, an administrator may only want certain severities sent. For example, it might be desirable to send only Emergency and Alert messages and no other severities.

This is achieved by setting the LogSeverity property to a list of the severities to be sent. For example, if only the Alert severity is specified then only that severity will be sent.

Example 20.2. Configuring the Log Severity Property

In this example, it is assumed that a Syslog server has already been configured in cOS Stream with the logical name my_syslog. The aim is to have only the log messages with a severity of Emergency or Alert sent to this server.

Command-Line Interface

System:/> set LogReceiver LogReceiverSyslog my_syslog
			LogSeverity=Emergency,Alert

Log Receiver Message Exceptions

After the LogSeverity property is applied, any associated LogReceiverMessageException filters are applied. These exceptions can explicitly include or exclude log messages of certain types for sending to the log server.

LogReceiverMessageException objects are created as one or more children to the log receiver object. Each child object acts as a filter for its parent and can have a combination of the following properties:

[Note] Note: The log event message severity cannot be changed

Each log event message has a single severity already assigned to it. This severity is fixed and cannot be changed. Each message's severity is documented in the separate Clavister NetShield Firewall Log Reference Guide.

Example 20.3. Adding a Log Message Exception

In this example, it is assumed that a Syslog server has already been configured in cOS Stream with the logical configuration name my_syslog. The requirement is to exclude the log message 161 ("Failed to Rekey IKE SA").

Command-Line Interface

First, change the current context to be the log receiver object:

System:/> cc LogReceiver LogReceiverSyslog my_syslog

Now, add the message exception:

System:/LogReceiverSyslog/my_syslog> add LogReceiverMessageException
			LogID=161
			Action=EXCLUDE

All the message exceptions can be listed for this receiver:

System:/LogReceiverSyslog/my_syslog> show

LogReceiverMessageException

  # Category Log Message ID Action
  - -------- -------------- -------
+ 1 IKE      161            EXCLUDE

Note that the object gets a unique index number to identify it, in this case 1, and this is used to refer to the exception in the CLI.

Finally, change back to the default CLI context:

System:/LogReceiverSyslog/my_syslog> cc
System:/>