Logging, Syslog and Log Anaylsys Forums
September 02, 2010, 05:47:04 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
   Home   WIKI BLOG Help Search Recent Topics GoogleTagged Login Register  
Pages: [1]
  Print  
Author Topic: Syslog-ng filter. How to log the exception?  (Read 2400 times)
webuser6479
Newbie
*
Offline Offline

Posts: 2


View Profile
« on: May 27, 2009, 11:30:38 am »

Team,

I would like to deploy the syslog-ng like below and not sure if that's possible.

1. Configure all network devices to send log to Host A that's running syslog-ng.
2. On Host A, apply a filter that matches certain strings in the log. If it matches, it forwards those events to Host B. Anything not forwarded(or say not matched to the filters) should be logged to a local log file for review later on.

What I was able to figure out is forwarding the logs with filter. However I can't figure out how to define a filter that covers what's not matched. I thought about using "not" in the filter and create another filter to inverse it. However if there is any neat trick, I would like to learn.

Thanks in advance,

Sam
Logged
mutex
Administrator
Newbie
*****
Offline Offline

Posts: 901


View Profile
« Reply #1 on: May 28, 2009, 08:30:42 pm »

I think you're looking for this:

filter f_test { not match("test"); };
Logged
webuser6479
Newbie
*
Offline Offline

Posts: 2


View Profile
« Reply #2 on: May 28, 2009, 08:52:15 pm »

That's what I did. I was hoping there was a way to negate whole complex filter easily. I have multiple nested filters like this. I am showing you a smaller subset of my filters. I have roughly 11 individual filters called by main one.

filter f_pix {
  filter(f_pix_5) and filter(f_pix_6);
  };
filter f_pix_6 {
  not match("(PIX|ASA)-6-(30501[12]|106100)|30201[3-6]|106015:");
  };
filter f_pix_5 {
  not match("(PIX|ASA)-5-304001:");
  };
Logged
mutex
Administrator
Newbie
*****
Offline Offline

Posts: 901


View Profile
« Reply #3 on: May 28, 2009, 09:05:37 pm »

You could do something like this:
Code:
filter f_notpix {
  not filter(f_pix);
};

filter f_pix {
  filter(f_pix_5) and filter(f_pix_6);
  };
filter f_pix_6 {
  not match("(PIX|ASA)-6-(30501[12]|106100)|30201[3-6]|106015:");
  };
filter f_pix_5 {
  not match("(PIX|ASA)-5-304001:");
  };

or am I missing something more?
Logged
Pages: [1]
  Print  

 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC | Sitemap Valid XHTML 1.0! Valid CSS!