Skip to content
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

Added handling of list of timestamp #17

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MaKeG0
Copy link
Contributor

@MaKeG0 MaKeG0 commented Feb 6, 2024

In GelfTcp there is already the possibility to have list of messages, i've added also list of timestamp so that, only in case of list of messages, they can be sent each with their message. Is also possible to have a list of messages with only 1 timestamp so also that possibility is handled.

In GelfHttp is a bit more complicated.
There was not a list handling but, according to graylog documentation, they introduced a way to handle bulk http GELF post. https://go2docs.graylog.org/5-0/getting_in_log_data/ingest_gelf.html So i've added the same list handling from Tcp but, as the bulking is made appending dumped JSON with \n\r at the end, and, most important, must be avoided to have \n or \r inside the dumped messages, i had to make some cases that handle all the above. To keep the rest as it is i've jumped the single message before so only 1 variable needs to be handled.

I know it's not clean, but i hope to have contributed with some interesting feature.

Have not tested it yet. Don't expect to have it merged as is

In GelfTcp there is already the possibility to have list of messages, i've added also list of timestamp so that, only in case of list of messages, they can be sent each with their message.
Is also possible to have a list  of messages with only 1 timestamp so also that possibility is handled.

In GelfHttp is a bit more complicated.
There was not a list handling but, according to graylog documentation, they introduced a way to handle bulk http GELF post.
https://go2docs.graylog.org/5-0/getting_in_log_data/ingest_gelf.html
So i've added the same list handling from Tcp but, as the bulking is made appending dumped JSON with \n\r at the end, and, most important, must be avoided to have \n or \r inside the dumped messages, i had to make some cases that handle all the above.
To keep the rest as it is i've jumped the single message before so only 1 variable needs to be handled.
typo and direct cleaning into gelf_message variable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant