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

Add support for custom event body serializer #83

Merged
merged 1 commit into from
Oct 26, 2018

Conversation

robinjhector
Copy link
Contributor

@robinjhector robinjhector commented Aug 2, 2018

After playing around with the library a few days, I found that at the current time, it's impossible to simply send the log message over HEC to splunk. By default, the logging adapter builds a rich json object with metadata fields such as severity, thread(name) etc.

I googled around online, and it seems like quite a few would like the possibility to format the message before sending the event payload. (Including #79)

Hence, I'm suggesting adding support to plug your own EventBodySerializer. Feedback very much appriciated.
Also made the HttpEventCollectorSender public & non-final for even more customisation support.

Customizable & pluggable event serializer support for the HttpEventCollectorAdapter.
@robinjhector robinjhector changed the title Support for custom event body serializer Add support for custom event body serializer Aug 2, 2018
@robinjhector
Copy link
Contributor Author

Hmm, Travis tests seems to fail because of an invalid HEC token. Not sure if I can solve those

@shakeelmohamed
Copy link
Contributor

Thank you for this work @izrobin! I took a quick look and this looks like a reasonable approach. We'll look into the CI issues when we get some spare cycles.

@zvaavtre
Copy link

Hi All,

Any update on this one? I was about ready to do pretty much the same thing (in our case to limit the message size so HEC would always get well formed json).

thanks

dave

@ljiang1 ljiang1 mentioned this pull request Oct 24, 2018
@ljiang1 ljiang1 merged commit 11798ee into splunk:develop Oct 26, 2018
@ljiang1
Copy link
Contributor

ljiang1 commented Oct 26, 2018

@zvaavtre I merged the PR to develop branch. We will do a release including this change soon.

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.

4 participants