Solved

rsyslog - using reverse DNS instead of hostname

Posted on 2011-09-21
7
2,582 Views
Last Modified: 2012-06-21
I currently have a rsyslog server setup to accept logs from our internal cisco devices.  It is working well, but it seems to be doing a TON of reverse DNS lookups.  It seems that the rsyslog server is using reverse DNS to find where the message is coming from rather than the hostname in the message.

Example of one of the messages:
Aug 22 11:33:58 cisco-test 17: 000014: Aug 22 11:33:57.726 est: %SYS-5-CONFIG_I: Configured from console by johnd on vty0 (x.x.x.x)

So it seems are messages are formatted correctly.  Here is my rsyslong.conf file:

# cat /etc/rsyslog.conf
$ModLoad imuxsock.so      # provides support for local system logging (e.g. via logger command)
$ModLoad imklog.so      # provides kernel logging support (previously done by rklogd)

$ModLoad imudp.so
$UDPServerAddress X.X.X.X
$UDPServerRun 514
$ModLoad imtcp.so  
$InputTCPServerRun 514

$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat

$template DynaFile,"/var/log/rsyslog/%HOSTNAME%/%HOSTNAME%-%$MONTH%-%$DAY%-%$YEAR%.log"
*.* -?DynaFile
:HOSTNAME, !isequal, "rsyslogserver" ~
*.info;mail.none;authpriv.none;cron.none                /var/log/messages
authpriv.*                                              /var/log/secure
mail.*                                                  -/var/log/maillog
cron.*                                                  /var/log/cron
*.emerg                                                 *
uucp,news.crit                                          /var/log/spooler
local7.*                                                /var/log/boot.log
0
Comment
Question by:savone
  • 4
  • 3
7 Comments
 
LVL 12

Expert Comment

by:hfraser
ID: 36577230
I expect the reverse DNS is happening because of the:

HOSTNAME, !isequal, "rsyslogserver" ~

filter which is based upon the actual hostname associated with the IP address of the system sending the message to your syslog server. Usually, this is done to implement different rules for different sources or messages. Is this something you need to do?
0
 
LVL 23

Author Comment

by:savone
ID: 36577688
Yes,
I have multiple (about 25-30) cisco devices all logging to this server.  

I use this line to make sure they are in their own folders so we can find the logs when we need them:
$template DynaFile,"/var/log/rsyslog/%HOSTNAME%/%HOSTNAME%-%$MONTH%-%$DAY%-%$YEAR%.log"

0
 
LVL 12

Expert Comment

by:hfraser
ID: 36578017
Understood. You can filter on parts of the message text, but the kind of flexibility you're looking for might be better suited to syslog-ng, which offers many more capabilities for routing messages to different files, including my IP address rather than hostname.
0
Network it in WD Red

There's an industry-leading WD Red drive for every compatible NAS system to help fulfill your data storage needs. With drives up to 8TB, WD Red offers a wide array of solutions for customers looking to build the biggest, best-performing NAS storage solution.  

 
LVL 23

Author Comment

by:savone
ID: 36578037
It would take me months if not years to get new software approved for our network.  Is there no way to get this resolved with rsyslog?

It looks like a reverse DNS query for every single log entry, this seems excessive.  
0
 
LVL 12

Accepted Solution

by:
hfraser earned 500 total points
ID: 36578088
I'm not aware of any way to create a filter by hostname, unless you want to maintain a list of filters by message content that look for hostnames in the message. That might mean a LOT of filters, and at the very least it's a maintenance nightmare.

If you're really concerned about the DNS traffic (the packets are small UDP messages, so it's not usually a lot of overhead), you could always suggest installing a caching slave DNS server on the syslog server itself. I've used this technique for high-volume DNS servers, more for pure performance than anything else. If your syslog server is a Unix box, you may already have bind installed on it and merely need to justify activating it and allowing it to be a slave to your main DNS servers, then add it as the DNS server in /etc/resolve.conf.
0
 
LVL 23

Author Comment

by:savone
ID: 36578188
That is a good idea.  I will look into that.  Thanks for the help.

0
 
LVL 23

Author Closing Comment

by:savone
ID: 36583451
Still considering this.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now