logging email filter

Description                                                    Configure a filter for emailing log messages.

Syntax                                                                  [no] logging email filter filter-num conditions operators [trigger]

Parameter

Description

filter-num

Specify the filter number (1-8).

conditions

Message attributes on which to match. The conditions list can contain one or more of the following:

  Severity levels of messages to send in email. Specify the severity levels by number or word:

  0 - emergency

  1 - alert

  2 - critical

  3 - error

  4 - warning

  5 - notification

  6 - information

  7 - debugging

  Software modules for which to email messages. Messages are emailed only if they come from one of the specified software modules. For a list of module names, enter ? instead of a module name, and press Enter.

  Regular expression. Standard regular expression syntax is supported. Only messages that meet the criteria of the regular expression will be emailed. The regular expression can be a simple text string or a more complex expression using standard regular expression logic.

operators

Set of Boolean operators (AND, OR, NOT) that specify how the conditions should be compared.

The CLI Boolean expression syntax is based on Reverse Polish Notation (also called Postfix Notation), a notation method that places an operator (AND, OR, NOT) after all of its operands (in this case, the con­ditions list).

After listing all the conditions, specify the Boolean operator(s). The following operators are supported:

  AND – All conditions must match in order for a log message to be emailed.

  OR – Any one or more of the conditions must match in order for a log message to be emailed.

  NOT – A log message is emailed only if it does not match the conditions

For more information about Reverse Polish Notation, see:

http://en.wikipedia.org/wiki/Reverse_Polish_notation

trigger

Immediately sends the matching messages in an email instead of buffering them. If you omit this option, the messages are buffered based on the logging email buffer settings.

Default                                                                Not set. Emailing of log messages is disabled by default.

Mode                                                                   Configuration mode

Usage                                                                  To configure the ACOS device to send log messages by email, you also must specify the email address to which to email the log messages. See logging email-address.

Below are some additional usage considerations:

     You can configure up to 8 filters. The filters are used in numerical order, starting with fil­ter 1. When a message matches a filter, the message will be emailed based on the buf­fer settings. No additional filters are used to examine the message.

     A maximum of 8 conditions are supported in a filter.

     The total number of conditions plus the number of Boolean operators supported in a filter is 16.

     The filter requires a valid module name, even if you omit the module option.

     For backward compatibility, the following syntax from previous releases is still sup­ported:

logging email severity-level

The severity-level can be one or more of the following (specify either the severity number o r name):

     0 - emergency

     1 - alert

     2 - critical

     5 - notification

The command is treated as a special filter. This filter is placed into effect only if the com­mand syntax shown above is in the configuration. The filter has an implicit trigger option for emergency, alert, and critical messages, to emulate the behavior in previous releases.

Example                                                            The following command configures a filter that matches on log messages if they are infor­mation-level messages and contain the string “abc”. The trigger option is not used, so the messages will be buffered rather than emailed immediately.

ACOS(config)#logging email filter 1 “level information pattern abc and”

 

The following command reconfigures the filter to immediately email matching messages.

ACOS(config)#logging email filter 1 “level information pattern abc and” trigger

 

Example                                                            The following example configures a filter to send email if the log message is generated by the “AFLEX” module and the severity level is “warning”:

ACOS(config)#logging email filter 1 “level warning module AFLEX and”

 

Example                                                            The following example configures a filter to send email if the log message has the pattern of “disk is full” or the severity level is “critical”:

ACOS(config)#logging email filter 2 “pattern disk is full level critical or”

 

Example                                                            The following example configures a filter to send email if the log message is generated by (module “SYSTEM” or “ALB”) and (the severity level is “alert” or has pattern of “unexpected error”)

ACOS(config)#logging email filter 3 “module SYSTEM module ALB or level alert pattern unex­pected error or and”

 

Table of Contents

Index

Glossary

-Search-

Back