is there any API available to implement Syslog server using Java (to capture all syslog messages - U

Discussion in 'Java' started by santa19992000@yahoo.com, Jun 20, 2006.

  1. Guest

    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.
     
    , Jun 20, 2006
    #1
    1. Advertising

  2. Rogan Dawes Guest

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

    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
     
    Rogan Dawes, Jun 20, 2006
    #2
    1. Advertising

  3. Chris Uppal Guest

    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("==========");
    }
    }
    }
     
    Chris Uppal, Jun 20, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian Donovan

    Replacing python: in syslog log messages

    Brian Donovan, Sep 5, 2003, in forum: Python
    Replies:
    1
    Views:
    397
    Jp Calderone
    Sep 6, 2003
  2. Replies:
    1
    Views:
    326
    LordLaraby
    Jan 7, 2006
  3. ZelluX
    Replies:
    7
    Views:
    271
  4. leroy isaac
    Replies:
    1
    Views:
    490
    James Willmore
    Oct 29, 2004
  5. Bad Dog
    Replies:
    0
    Views:
    241
    Bad Dog
    Aug 9, 2007
Loading...

Share This Page