question about clients-server configuration

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

question about clients-server configuration

Postby tc_le » Mon Oct 20, 2008 11:22 am

Hi,

I need to send logs from clients to a server following this steps:
- mysql writings must be done once datas are received via RELP protocol not via mysql output module.
- server-side, datas received from hosts, must be written in database only, not in logfile.

So I simply added client-side these lines in the rsyslog.conf file:
Code: Select all
$ModLoad omrelp.so
*.*     :omrelp:svr_ip_addr:20514;RSYSLOG_TraditionalFileFormat


And server-side:
Code: Select all
$ModLoad imrelp.so
$ModLoad ommysql.so

# Start RELP Server
$InputRELPServerRun 20514

# Store logs in mysql
*.*     :ommysql:localhost,dbName,dbUser,dbPwd


Server-side everything is correctly recorded on disk and database , but I don't want the client logs to be record on disk.
I know the basic schema is to do something like:
Code: Select all
# logs everything from localhost and clients to database
*.*     :ommysql:localhost,dbName,dbUser,dbPwd

# only keep localhost logs in /var/log/right_log_files
if $source == 'localhost' then "do local things"


However, I don't get the 'localhost' value in my logfiles but the hostname . So is there a property from rsyslog to access the server hostname without hard-coding it's name.

Regards,

TCL
tc_le
New
 
Posts: 2
Joined: Mon Oct 20, 2008 10:49 am

Professional Services Information

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

Re: question about clients-server configuration

Postby tc_le » Mon Oct 20, 2008 11:49 am

hi again,

solved my question: replaced
Code: Select all
if $source == 'localhost'

by
Code: Select all
if $fromhost-ip == '127.0.0.1'


Regards,

TCL
tc_le
New
 
Posts: 2
Joined: Mon Oct 20, 2008 10:49 am

Re: question about clients-server configuration

Postby prakash.akumalla » Mon Oct 20, 2008 12:27 pm

good
prakash.akumalla
Frequent Poster
 
Posts: 103
Joined: Thu Jun 26, 2008 2:37 pm

Google Ads



Return to Configuration

Who is online

Users browsing this forum: No registered users and 1 guest

cron