Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Chunked messages for GELF 1.0 #4

merged 1 commit into from

2 participants


Somehow my Graylog2 server didn't want to accept chunked messages with the error message Invalid GELF header in message: Could not extract sequence number.

A little bid of digging revealed, that that message headers aren't set according to the most current specification I could find:

After changing the sequence length and sequence numbers to single bytes and the message ID to 8 bytes the server accepts the mesages again.


This won't work for those that still use older versions. The solution is great but how can we make this backward compatible?
Maybe a better alternative is to create another handler for the new format and add deprecation warnings for the existing one.
What do you think?


Yeah, that sounds like a good idea. I'm really new to Graylog2, so I have no experience with any older versions.


BTW, what version of Graylog are you using?

@severb severb merged commit 57ad6a9 into severb:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +3 −3 graypy/
6 graypy/
@@ -83,8 +83,8 @@ class ChunkedGELF(object):
def __init__(self, message, size):
self.message = message
self.size = size
- self.pieces = struct.pack('>H', (len(message) / size) + 1)
- = struct.pack('Q', random.randint(0, 0xFFFFFFFFFFFFFFFF)) * 4
+ self.pieces = struct.pack('B', (len(message) / size) + 1)
+ = struct.pack('Q', random.randint(0, 0xFFFFFFFFFFFFFFFF))
def message_chunks(self):
return (self.message[i:i+self.size] for i
@@ -94,7 +94,7 @@ def encode(self, sequence, chunk):
return ''.join([
- struct.pack('>H', sequence),
+ struct.pack('B', sequence),
Something went wrong with that request. Please try again.