Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2006

Tip: Looking for answers? Try searching our database.

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

Thread view: 
santa19992000@yahoo.com - 20 Jun 2006 12:38 GMT
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.
Rogan Dawes - 20 Jun 2006 13:03 GMT
> 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
Chris Uppal - 20 Jun 2006 13:54 GMT
> 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("==========");
 }
}
}


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.