rsyslog
May 17, 2008 - 07:59 AM

Donate!
Satisfied with rsyslog?

Donate and help keep
the project alive!

Rainer's Blog

Login




 


 Log in Problems?
 New User? Sign Up!

Online
There are 22 unlogged users and 0 registered users online.

You can log-in or register for a user account here.

FAQ
FAQ  :: How to separate log files by host name of sending device? ::
(2659 Reads)  
Posted by mmeckelein on Friday, October 20, 2006 - 05:50 PM

Question:
I have activated remote logging and receiving syslog messages from several devices. I want to write a separate log file for each device sending syslog messages. How to achieve that?

Answer:
It is pretty easy. You can use dynaFiles for it. With them, you specify a template as the file name. For each message, the filename is re-generated and the output written to the respective file. Read the config file doc for details, but it basically is:

$template DynaFile,"/var/log/system-%HOSTNAME%.log"
*.* -?DynaFile

Send this story to someone  Printer-friendly page

Comments


Only logged in users are allowed to comment. register/log in Bottom 
Author Comment
acim Subject: But how to stop logging in file message? posted: Mar 25, 2008 - 09:07 AM
acim's Avatar

registered: Nov. 2007

I put this in rsyslog.conf file and it started logging to separate files, but it still logs in message file also, which I don't want.

Here is what I put in rsyslog.conf:

$template DynaFile,"/var/log/remote/%FROMHOST%.log"

*.* -?DynaFile

I put FROMHOST because HOSTNAME doesn't work for Mikrotik devices. My operating system is Fedora 8. Thank you in advance.

Top  acim send PM
rgerhards posted: Mar 25, 2008 - 09:17 AM
rgerhards's Avatar

registered: Jun. 2005

Please use the forum for support questions.

Top  rgerhards send PM
 Search
 
Google

 Last Forum Posts
 · Re: Transport With Stunnel-need your hel ...
Sorry, I overlooked the message. This looks like a duplicate port ...
· Re: if ... then ... else
I've re-read the whole thread. I think I now got it. Else is just ...
· Re: if ... then ... else
sandiso wrote:So I have many boxes and from few of those boxes I ...
· Re: if ... then ... else
You got me confused. I think my config is right but I`ll explain ...
· Re: if ... then ... else
Thanks for the files (received via mail). The problem was always ...

 Top Contributors
 
Contributor Contribs
varmojfekoj 7
Michael Biebl 2
Michel Biebl 1
Peter Vrabec 1


 Past Articles

:: Syndication: ::
Page created in 0.198730945587 seconds.