# Re: syslog lib/module for remote logging

**URL:** <https://www.ruby-forum.com/t/re-syslog-lib-module-for-remote-logging/62272>\
**Category:** Ruby\
**Created:** [June 2, 2006, 2:50am UTC](https://www.ruby-forum.com/t/re-syslog-lib-module-for-remote-logging/62272 "2006-06-02T02:50:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![PeSSSSaS\_Botp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ecd19e/32.png) [@PeSSSSaS\_Botp](https://www.ruby-forum.com/u/PeSSSSaS_Botp)\
**Post date:** [June 2, 2006, 2:50am UTC](https://www.ruby-forum.com/t/re-syslog-lib-module-for-remote-logging/62272/1 "2006-06-02T02:50:26Z")

</div>

fr Francis:

# You have to configure your logging server to accept remote

# logs. If your source server is Unix, then it’s an easy config

# on the local side to send to a remote server. If your source

# is Windows, then you can send UDP packets to the remote side

# but it’s more work. Is that what you’re trying to do?

Yes, no problem with the \*nix server and clients.  
I need the win clients to be able to send. But a pure ruby solution  
would be great since i may be able to use the same program for all.

thank you and kind regards -botp

---

<div class="post-metadata">

**Author:** ![PeSSSSaS\_Botp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ecd19e/32.png) [@PeSSSSaS\_Botp](https://www.ruby-forum.com/u/PeSSSSaS_Botp)\
**Post date:** [June 2, 2006, 5:33am UTC](https://www.ruby-forum.com/t/re-syslog-lib-module-for-remote-logging/62272/2 "2006-06-02T05:33:02Z")

</div>

Hi,

> # is Windows, then you can send UDP packets to the remote side
> 
> # but it’s more work. Is that what you’re trying to do?
> 
> Yes, no problem with the \*nix server and clients.  
> I need the win clients to be able to send. But a pure ruby solution would  
> be great since i may be able to use the same program for all.
> 
> thank you and kind regards -botp

You can try something like this:

require ‘socket’  
require ‘win32/eventlog’  
include Win32

syslog\_dest = 13  
syslog\_port = 514  
syslog\_server = ‘192.168.123.122’

s = UDPSocket.new  
EventLog.open(‘Application’).tail{ |log|  
message = “WinEventLog  
#{log.time\_generated.asctime}||#{log.event\_type}||#{log.source}||#{log.computer}||#{log.user}||#{log.description}”  
s.send("\<#{syslog\_dest}\>#{message}",0,syslog\_server,syslog\_port)  
}

Regards,

Park H.
