Giter VIP home page Giter VIP logo

Comments (9)

AlekSi avatar AlekSi commented on July 30, 2024

Length of uncompressed chunked GELF message is 12 bytes. Looks like a bug in comment. Lennart?

from graylog2-server.

t0xa avatar t0xa commented on July 30, 2024

Hello AlekSi,

Okay but the here's code from GELF.java:

public static final int GELF_HEADER_LENGTH = 38;

byte[] rawGELFHeader = new byte[GELF.GELF_HEADER_LENGTH];
for (int i = 0; i < GELF.GELF_HEADER_LENGTH; i++)  {
     rawGELFHeader[i] = message.getData()[i];
}

// Make sure that GELF header begins with 30,15 (<3 Boris Erdmann)
if (rawGELFHeader[0] != 30 || rawGELFHeader[1] != 15) {
    throw new InvalidGELFHeaderException("Invalid GELF ID.");
}

To me it looks like 38 bytes of GELF header or probably I'm missing something.

A.

from graylog2-server.

lennartkoopmann avatar lennartkoopmann commented on July 30, 2024

I'm in the office right now, but will take a look at this later. Thanks so far!

from graylog2-server.

lennartkoopmann avatar lennartkoopmann commented on July 30, 2024

I researched this and can remember talking about this with Aleksi. Aleksi, is the GELF gem currently using the 12bytes header? The server is definitely still using the 38 byte spec:

public static final int HEADER_PART_SEQCNT_START = 36;
public static final int HEADER_PART_SEQCNT_LENGTH = 2;

Thanks for reporting this, t0xa!

from graylog2-server.

t0xa avatar t0xa commented on July 30, 2024

Hello Lennart,

Thanks for clarification. Could you please advice on a implementation then. Should I create an implementation based on 38 bytes header?

For the safe side could you please confirm flow for the chunked GELF in general?

  1. GZIP long message
  2. If gzipped message is larger that 1420 bytes (1500 MTU - 28 bytes UDP header = 1472 bytes) 1472 - 12 bytes GELF header which leaves us 1460 bytes of payload. So we split gizpped message in 1460 bytes pieces
  3. Creating the datagram consisted of GELF header + message piece
  4. Send via UDP to Graylog server

Thanks a lot for doing great job!

from graylog2-server.

lennartkoopmann avatar lennartkoopmann commented on July 30, 2024

Please use the 38 bytes header for now as this will be working with the current graylog2-server. I'll keep you up to date on when and if to change to the 12 bytes.

Your flow sounds good. (If using 38, not 12 bytes)

from graylog2-server.

t0xa avatar t0xa commented on July 30, 2024

Thanks a lot! Maybe it's a good idea to mention the 38 byte business in the GELF Wiki and close this issue?

Anton

from graylog2-server.

lennartkoopmann avatar lennartkoopmann commented on July 30, 2024

Yepp but I'll talk with Aleksi about this first as we already has a discussion on this. :)

from graylog2-server.

lennartkoopmann avatar lennartkoopmann commented on July 30, 2024

This has been clarified in the mean time - You should have received an email today. The GELF documentation is correct now, the server follows it.

from graylog2-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.