Support Support Downloads Knowledge Base Case Manager My Juniper Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[EX] How to filter two or more specific messages from being written to the syslog file

1

0

Article ID: KB22177 KB Last Updated: 24 Feb 2020Version: 3.0
Summary:

This article provides information on how to prevent two or more specific messages from being written to the syslog file.

 

Symptoms:

Customers may already know how to use the match option to block a specific syslog message from logging to a syslog file; but they do not know the syntax to block two or more specific messages. This article provides information on how to achieve this goal.

 

Solution:

To block two or more specific messages logged into a syslog file, the following syntax can be used:

match "!(keywords|keyword2|keyword3)";

For example, the following syslog messages are harmless, but annoying as they may be generated frequently:

  • Aug 26 11:52:42 EX4200 /kernel: vlan MAC filter: 01:00:5e:00:00:12 from port ge-0/0/23 rejected"
  • Sep 6 10:00:20 EX4200 fpc0 Failed to find MC RT_NH entry (idx 8) for aging
  • Jan 12 20:00:46 EX4200 fpc0 Resolve request came for an address matching on Wrong nh nh:1050, type:Hold...?   

To exclude these kind of messages from being written to the /var/log/messages file, try to find the keyword from each of them.

For example, vlan MAC filter for keyword 1, Failed to find MC RT_NH entry for keyword 2, and matching on Wrong nh for keyword 3. Then the following configuration example could implement such a requirement:

{master:0}[edit]
     lab@EX4200-48T# show system syslog                  
     user * {
        any emergency;
     }
     file messages {
         any notice;
         authorization info;
         match "!(vlan MAC filter|Failed to find MC RT_NH entry|matching on Wrong nh)";
     }
     file interactive-commands {
         interactive-commands any;
     }

 

Modification History:

2020-02-24: Article checked for accuracy; article found to be relevant and valid; no changes made

 

Related Links

Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search