Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > is there any API available to implement Syslog server using Java (to capture all syslog messages - UDP protocol, port 514)?

Reply
Thread Tools

is there any API available to implement Syslog server using Java (to capture all syslog messages - UDP protocol, port 514)?

 
 
santa19992000@yahoo.com
Guest
Posts: n/a
 
      06-20-2006
I am looking to implement syslog server using Java (this syslog server
captures all syslog messages whihc are coming on network, all machines
on netwrok sends syslog messages),
is there any API available to implement Syslog server using Java (to
capture all syslog messages - UDP protocol, port 514)?. appreciated.

 
Reply With Quote
 
 
 
 
Rogan Dawes
Guest
Posts: n/a
 
      06-20-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> I am looking to implement syslog server using Java (this syslog server
> captures all syslog messages whihc are coming on network, all machines
> on netwrok sends syslog messages),
> is there any API available to implement Syslog server using Java (to
> capture all syslog messages - UDP protocol, port 514)?. appreciated.
>


Is there any particular reason that you want to do this in Java? For a
large scale syslog server, you would be much better off using an
optimized language such as C.

And no, I'm not really on the bandwagon that C is faster than Java, but
for a specialised task such as this, where you have extreme volumes of
data, you probably DO want to do this in the fastest language available
to you.

For some more ideas on log analysis, take a look at loganalysis.org, and
also look for Marcus Ranum's discourse on log analysis on the
firewall-wizards list earlier this year.

Rogan
 
Reply With Quote
 
 
 
 
Chris Uppal
Guest
Posts: n/a
 
      06-20-2006
Rogan Dawes wrote:

> And no, I'm not really on the bandwagon that C is faster than Java, but
> for a specialised task such as this, where you have extreme volumes of
> data, you probably DO want to do this in the fastest language available
> to you.


Here's a counter-view:

I'm not really on the bandwagon that java is better than C, but for a task such
as this, where you have uncontrolled, and potentially hostile, data sent to you
from anywhere on the network (or even the Net if your firewall's broken or
compromised), you probably don't want to use an unsafe language such as C.



In reality, of course, it mostly depends on what the OP wants to do, and what
constraints (performance and others) have to be satisfied.

But I know of no reason why a syslog listener couldn't be written in Java[*],
whether that is the optimal approach is another question.

-- chris

[*] A grossly over-simplified implementation:

import java.net.*;
import java.io.*;

public class Syslog
{
private static final int PORT = 514;
private static final int BUFFER_SIZE = 10000;

public static void
main(String[] args)
throws IOException
{
new Syslog().run();
}



private void
run()
throws IOException
{
DatagramSocket socket = new DatagramSocket(PORT);
DatagramPacket packet = new DatagramPacket(
new byte[BUFFER_SIZE],
BUFFER_SIZE);
for (;
{
packet.setLength(BUFFER_SIZE);
socket.receive(packet);
System.out.printf("Got %d bytes from %s%n",
packet.getLength(),
packet.getSocketAddress());
System.out.write(packet.getData());
System.out.println("==========");
}
}
}




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
There are no more messages on this topic. All messages in this topic may have expired or been deleted Coach 02 Computer Support 1 03-12-2007 03:44 PM
How to use java to write a tcp OR udp program which can implement communications between two hosts in a Lan? entrepreneur Java 11 01-01-2007 08:25 PM
Re: Listen in promiscuous mode (Sniffer) on UDP port 162 and copypacketsto another port Gerald Klix Python 0 10-26-2005 08:11 AM
will all these messages cause a problem . I am a new subscriber and my computer is downloading 100,000 messages. Will this cause any kind of a problem with my ability to store other items?? Camille White Camille White Computer Support 9 11-08-2004 01:13 AM
When i try to implement a server program giving UDP as protocol , it works fine , but if the same code is executed with TCP as protocol option, it gives an error. Tompyna Perl Misc 4 02-17-2004 06:51 PM



Advertisments