-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gelf event handler #1788
Gelf event handler #1788
Conversation
1st improvements compact json next finnal version
Cool, thanks! You may want to rename this PR to event handler, rather than forwarder, though, as I thought this was media-related. Being UDP based, how does this handle big events? SDP offer/answers can go way beyond the MTU, and it will be even worse once we merge the unified-plan branch. I'm not familiar with GELF, so I'll look into it and review the code. |
Indeed, there is udp chunking with magic number and packet sequence: Looks like I can't change the title, but maybe need to start new PR? Most importantly is that if event handler can't connect to gelf that core and rest of the plugins work normally. Update: title changed in desktop version |
Yep, the chunking part looks useful, and so does compression (but that would be true for other plugins as well, I'll have to check that). Do you plan to add chunking to the PR? |
I will give it a try :D |
@lminiero can you help me a bit because I got stuck at this chunking and can't resolve it. You can see the result in this result
I'm doing something wrong with this pointer or this 6 bytes are messing everything up, but i'm not sure where they come from. Hope you have time to help, |
Probably some strings manipulation error? Sorry, can't look into this right now. |
Hi @mirkobrankovic,
|
@atoppi thanks a lot for pointers :) |
745f097
to
eb87505
Compare
TCP is working, now to fix UDP. |
If this Gelf thing supports gzip, you may want to have a look at the utils I added recently for the purpose, which should help reduce the size of data on UDP (unless Gelf has its own fragmentation mechanisms). |
@lminiero thanks I saw it the other day and thought about it. |
TCP compression is not supported cause of the '\0' but for UDP it is possible, just need to see if then I need to stop chunking or not .... |
wow it is all connected :D |
Tested all cases and there is the network sniff: |
Feature/gelf compression
I reviewed all 3 segments of the comments and I think I addressed most of them. This one if puzzling me, what did you mean by this, to decide if message should be sent uncompressed or not?:
Thanks a lot for your time to do this, I really appreciate it. PS. unfortunately Github is not giving the best user experience with this comment/review/commits all in one thread view |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I added some more notes.
Feature/gelf compression
Feature/gelf compression
addressed invalid values:
@lminiero when you get time, can you review new changes ? thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I did another round of review: some are just nits, but there are a couple of things that I think need to be addressed.
Feature/gelf compression
Feature/gelf compression
@lminiero I refactored tcp send to make sure all bytes are sent, but while debugging I haven't seen sent less then size (every time is sent in one go, even when messages are 2500 chars long), but better to be safe. Can you do one more round? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry if this took so long, I must have missed your last message, and I came back here after the discussion on the group about that other effort related to GrayLog. I added a few notes: very minor, as you'll see, so I think we're very close to merging (for real this time 😄 ). I'll check how complex installing a Graylog instance for testing is, to see if I can test it myself, but that would be just out of curiosity: you've been using it long enough, so if it works for you, I'm sure it does its job!
int offset = 0; | ||
char *rnd = randstring(8); | ||
for (int i = 0; i < total; i++) { | ||
int bytesToSend = offset + max_gelf_msg_len < len ? max_gelf_msg_len : len - offset; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to wrap the items with a math operation in brackets, here, or there may be ambiguities: if not for the compiler, for who reads the code for sure.
I think this has been around long enough (I see you opened the PR during JanusCon 😱 ), and I think it's fine as it is (I can fix small nits myself, if I find any). Thanks again, merging! |
Made some minor changes (mostly code style), and changed the configure to by default compile the module: your patch had |
Thanks a lot, I have a lot of problems with this VS Code style and auto-correct on different languages :D |
Simple TCP/UDP socket event handler to gelf interface.
Config file is simple, you need filter, host, port
will look like this in Graylog interface
Still need to think about message structure and custom fields.