Log Redirection to Remote Host

hey,

I need your help.

I have a rhel server that runs application, that application writing to her local application log.

I want that log will be realtime copying to a another remote rhel server.

The thing is that I prohibited touch the application code.

Is that possible?

Thanks

How about:

tail -f log_file | ssh user@host "sh -c 'cat > remote_log_file'"

AMAZING.
thank you!

how do i permanence this? everyboot

and how do i logrotate this?

For starting it during every boot, you can write a script and put it in /etc/init.d/ . Google for instructions to start a command during boot up.
I think Log-rotation is going to be difficult for above command. May be you can force kill it and start with another file name when log size reaches a defined threshold.

It is probably easier to create a syslog-facility for this. Then you can use syslog to put this log output to another host. See the man page of syslog for details about how to achieve this.

I hope this helps.

bakunin

thats what i tought!
doing it with syslog or rsyslog, but i know that the configuration is only by: facility and priority.
I search and the facilities are only by: mail.* , cron.* , kern.* ...

If you know how to manage an external application log with a syslog or rsyslog, its better and i would like to know how.

Thanks alot.