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

Support for raw events #98

Closed
lorenzobenvenuti opened this issue May 23, 2022 · 6 comments
Closed

Support for raw events #98

lorenzobenvenuti opened this issue May 23, 2022 · 6 comments

Comments

@lorenzobenvenuti
Copy link

Hi,

any plans to support raw events? If you're OK with that, I can try to put a PR together.

Thanks,

lorenzo

@vietk
Copy link
Contributor

vietk commented May 24, 2022

Hello @lorenzobenvenuti,

No raw events planed on our side yet.
If you need it, you are more than welcome to contribute.

Regards

@lorenzobenvenuti
Copy link
Author

lorenzobenvenuti commented May 25, 2022

Hi @vietk ,

I played a bit with the library and HEC and realized that my use case can be solved in two ways: either using raw events or supporting a custom event serializer. The issue with the current approach is that the event field content is something like

{
  "message": "my log message"
   "severity": "INFO"
   "time": 1653464900.155
}

My problem is that I want to index just my log message (I already have a source type for that), not the JSON wrapper.
Using raw events solves the issue, because the client performs a POST with just the original message; an alternative approach would be allowing the users to specify a custom EventBodySerializer to customize the event field content (see com.splunk.logging.serialization.HecJsonSerializer#serialize). For example, my use case could be solved by injecting a PlainTextEventBodySerializer which is already provided by splunk-library-javalogging. Probably this approach is more flexible than raw events? Thoughts?

Thanks,

lorenzo

@vietk
Copy link
Contributor

vietk commented May 27, 2022

I would say, if raw events is already fitting your need, just contribute for that, it probably also fit also for some other people.
I have the feeling that the EventBodySerializer is more for specific case or maybe things that would be fixable or server side.

@lorenzobenvenuti
Copy link
Author

Hi @vietk , I've just created an MR implementing support for raw events: #99

@vietk
Copy link
Contributor

vietk commented May 31, 2022

ok will look at it ASAP

@rquinio1A
Copy link
Member

@lorenzobenvenuti Thanks for the contribution, it's released in 2.3.0!
In case you want to be credited in the README I think you need to ask the bot in #1

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

No branches or pull requests

3 participants