| Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
| 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. |
|
 |
03-10-2009, 01:35 PM
|
#1
|
|
Member
Registered: May 2007
Location: London, UK
Distribution: Kubuntu 9.04 x64 / Ubuntu Server 9.04 x64
Posts: 50
Rep:
|
Logging syslog messages from a particular IP to individual file
Hi All
I'm looking for a way to be able to log messages generated by a network host onto my CentOS 5.2 box into an individual file.
Now setting up syslog (I'm using the default sysklogd for CentOS) is the easy part; I've ensured that the following line is present in my /etc/sysconfig/syslog file:
Code:
SYSLOGD_OPTIONS="-m 0 -r"
This works a treat... the only issue is that the network host creates the following types of messages (i.e. Facilities and Priorities):
Code:
local7.warn
auth.warn
kern.warn
auth.info
... the problem that I have is that these get put into the same file as anything else using these matching facilities (local7 being a good example as this logs by default to /var/log/boot.log). What I'd like to do is be able to filter the incoming messages by IP address as well. So for example, I'd like to say "if the syslog message is coming from 192.168.1.11 and has local7.warn as the facility & priority log it to /var/log/192.168.1.11.log"
I've done a lot of looking around but have had no joy... can anyone tell me to RTFM in the right direction?
Thanks for reading! Simp.
Last edited by simplified; 03-10-2009 at 01:48 PM.
|
|
|
|
03-10-2009, 02:06 PM
|
#2
|
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,816
|
*cough* syslog-ng *cough*
The rpm will function exactly the same as the standard syslogd and klogd configs with centos, and then it's really quite nice to add extra config to do what you want, in a much nicer way that syslogd.conf allows.
|
|
|
|
03-10-2009, 02:07 PM
|
#3
|
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,816
|
|
|
|
|
03-10-2009, 03:48 PM
|
#4
|
|
Member
Registered: May 2007
Location: London, UK
Distribution: Kubuntu 9.04 x64 / Ubuntu Server 9.04 x64
Posts: 50
Original Poster
Rep:
|
Cool! Thanks all... I'll check it out and let you know how I get on.
|
|
|
|
03-11-2009, 02:48 AM
|
#5
|
|
Member
Registered: May 2007
Location: London, UK
Distribution: Kubuntu 9.04 x64 / Ubuntu Server 9.04 x64
Posts: 50
Original Poster
Rep:
|
Perfecto!
Hi Guys
Many thanks for the pointer - this is exactly what I was after!
Simp.
|
|
|
|
03-11-2009, 04:10 AM
|
#6
|
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,816
|
syslog-ng is pretty great. Many people don't like the alternative syntax on principle, when there are other syslogd replacements like rsyslog which keep the same basic syntax. But ng is great and very flexible without being necessarily complicated.
|
|
|
|
03-12-2009, 10:26 AM
|
#7
|
|
Member
Registered: May 2007
Location: London, UK
Distribution: Kubuntu 9.04 x64 / Ubuntu Server 9.04 x64
Posts: 50
Original Poster
Rep:
|
Hi Chris
Thanks for that - do you have any recommendation on documentation for the free version, there seem to be two available.
Don't worry if you don't just thought I'd ask the question
OL
|
|
|
|
03-12-2009, 02:03 PM
|
#8
|
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,816
|
http://www.campin.net/syslog-ng/faq.html this is a great page, lots of clever hangups dealt with there.
|
|
|
|
| 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 12:02 AM.
|
|
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
|
|