Mailing List Archive

Dynamic remote log files
I have the following set up to generate Dynamic remote log files.

$template DYNmessages, "/var/log/remote/%HOSTNAME%/messages"
*.info,mail.none,authpriv.none,cron.none ?DYNmessages


Unfortunately some devices log poorly without the hostname for some
syslog messages. This means I'm ending up with lots of useless
directories in /var/log/remote.

If I log everything from a server to a file then it works fine:
if $fromhost == 'server' then /var/log/remote/server/all

As you can see the difference in file sizes as syslog messages are lost:
# ls -l /var/log/remote/server/
total 1724
-rw------- 1 root root 980053 Mar 17 08:57 all
-rw------- 1 root root 773533 Mar 17 08:57 messages

I guess, I'm looking for config suggestions on setting up more robust
dynamic logging for remote hosts.

- Julian
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com
Re: Dynamic remote log files [ In reply to ]
On Tue, Mar 17, 2009 at 13:44, Julian Yap <julianokyap@gmail.com> wrote:
> I guess, I'm looking for config suggestions on setting up more robust
> dynamic logging for remote hosts.

The single most robust host-based structure I've found to use is
'fromhost-ip'. It's locally "generated" by the rsyslog daemon from
the receiving socket and isn't affected by any of the message content.
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com