Problem matching localhost

This is the place for you, if you got rsyslog up and running but wonder how to make it do what you want.

Moderator: rgerhards

Problem matching localhost

Postby niallel » Thu Jul 03, 2008 11:56 pm

Hi,

I'm running 2.0.0-11 (version included with redhat 5.2)

I want to filter all the messages from external syslog devices to one file and all messages from the localhost to another file.

However even with the -x option turned on when a local service (such as crond) sends a message to the log the hostname is set to the domain name of the server.

So I can't use the following to match:
:HOSTNAME, isequal, "localhost" /var/log/messages
:HOSTNAME, !isequal, "localhost" /var/log/externalsyslog

I could replace "localhost" with "dnsname" to get it to work, but I would like a generic method that will work on all the syslog servers I have.

I've also tried :FROMHOST-IP, !isequal, "127.0.0.1" ?SyslogOutputFileName
but a debug tells me that FROMHOST-IP is an invalid property name.

Is there some switch that will cause rsyslog to report the local services as sending from localhost or 127.0.0.1 rather than the hostname of the localhost.


thanks,

niall
niallel
New
 
Posts: 1
Joined: Thu Jul 03, 2008 11:52 pm

Professional Services Information

  • Custom written rsyslog.conf?
  • Maintenance Contract?
  • Installation support?

Re: Problem matching localhost

Postby prakash.akumalla » Fri Jul 04, 2008 6:32 am

Hi,

You use expression filters as shown in http://www.rsyslog.com/doc-rsyslog_conf.html
or
you change one the name of local host to some other in /etc/hosts and let me know whether it works.
prakash.akumalla
Frequent Poster
 
Posts: 103
Joined: Thu Jun 26, 2008 2:37 pm

Re: Problem matching localhost

Postby rgerhards » Fri Jul 04, 2008 7:11 am

Mhhh... I think there is no generic way to do that in v2... Anyone else?
User avatar
rgerhards
Site Admin
 
Posts: 2196
Joined: Thu Feb 13, 2003 11:57 am

Re: Problem matching localhost

Postby hkspvt » Mon Jul 07, 2008 10:34 pm

Have you tried using fromhost-ip in lower case? The properties were case sensitive prior to 3.17.0...

-HKS
hkspvt
Frequent Poster
 
Posts: 125
Joined: Thu Jun 26, 2008 6:31 pm

Google Ads



Return to Configuration

Who is online

Users browsing this forum: MSN [Bot] and 0 guests

cron