Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
07-02-2009, 04:29 PM
|
#1
|
|
LQ Newbie
Registered: Aug 2004
Posts: 12
Rep:
|
Syslog Content Based Filtering
Is there a way to perform a content based filtering with syslog? Maybe a particular implementation that does content based filtering or some way to filter out the log files outside of the implementation itself?
|
|
|
|
07-02-2009, 04:35 PM
|
#2
|
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,707
|
i think that language like "content based filtering" is probably a little too grand as it's normally related to enterprise Layer 7 load balancing and such, but I think I know what you mean, in which case check out syslog-ng with it's "match()" functionality.
|
|
|
|
07-09-2009, 06:33 PM
|
#3
|
|
LQ Newbie
Registered: Aug 2004
Posts: 12
Original Poster
Rep:
|
Thank you for your reply. My apology. I am a bit new to the world of network, so please bear with me.
I have in fact tried syslog-ng from balabit. However, I ran into issues with that implementation.
Here is a sample of the syslog-ng messages my router sends to my syslog server:
<133>Jul 02 10:49:45 default-system-log [audit][notice] TEST!!!
As you can see, the third param "default-system-log" is in a spot where the host name usually resides. I want to be able to filter on this field. However, it seems that with syslog-ng, they discard this field and replace it with the actual ip. I have tried various different macros such as $HOST, $HOST_FROM, $FULLHOST, etc. All these macros end up printing out either the ip or the dns name of the hosts. None returns the actual string that I have passed in the host field in the actual syslog message. Any idea how to get to that attribute? Should I pursue a different syslog implementation, like rsyslog?
|
|
|
|
07-10-2009, 04:43 PM
|
#4
|
|
LQ Newbie
Registered: Aug 2004
Posts: 12
Original Poster
Rep:
|
I have found the solution.
In the source definition of the syslog-ng configuration, the param "keep-alive(yes)" needs to be enabled. Once that is enabled, the string I am passing through the host param becomes available for matching and logging. That solves the problem. Thanks for your help, acid_kewpie!
|
|
|
|
07-11-2009, 02:04 AM
|
#5
|
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,707
|
enabling a keep-alive won't change the data saved to a log file. There must be a different change you made to, e.g. setting keep_hostname(no) and chain_hostname(yes), or setting a bad_hostname to filter out the non-hostname you have
Last edited by acid_kewpie; 07-11-2009 at 02:05 AM.
|
|
|
|
07-11-2009, 06:06 PM
|
#6
|
|
LQ Newbie
Registered: Aug 2004
Posts: 12
Original Poster
Rep:
|
My apology. I meant "keep_hostname(yes)".
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 10:29 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|