Logging, Syslog and Log Anaylsys Forums
July 30, 2010, 09:56:39 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: Hostname instead of IP addresses  (Read 464 times)
Kreno
Newbie
*
Offline Offline

Posts: 6


View Profile
« on: February 16, 2010, 07:56:45 am »

Hello all,

I am pretty new to syslog-ng. I have configure it on Opensolaris.
I would like to configure in syslog-ng that instead of IP addresses I would like to get Hostname(s) from network devices, when syslog-ng is creating folders and log files. I do not have DNS server in my test environment and I have put all names and IP addresses in /etc/hosts file. Curently syslog-ng is logging like this: /var/log/syslog-ng/router/192.168.1.1/2010/192.168.1.1.log

Any help appreciated.

Thank you and kind regards, M
Logged
Admin
Administrator
Newbie
*****
Online Online

Posts: 146


View Profile WWW
« Reply #1 on: February 16, 2010, 09:21:11 am »

A destination statement like this:

  destination hosts {
   file("/var/log/syslog-ng/$HOST/$HOST.log";
  };
 
should do the trick.
Logged
Kreno
Newbie
*
Offline Offline

Posts: 6


View Profile
« Reply #2 on: February 17, 2010, 04:18:34 am »

Thank you. Also the problem was that I had to change: use_dns (off ); to use_dns (persist_only);


Thank you and kind regards, Marko
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!