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 fields to log message using HttpEventCollectorLogbackAppender #263

Open
christophersavory opened this issue Nov 9, 2022 · 0 comments

Comments

@christophersavory
Copy link

curl -k https://<host>:443/services/collector/event -H "Authorization: Splunk <token>" -d '{"event": "Hello, world!", "sourcetype": "test-sourcetype", "host": "test-host", "source": "test-source", "fields":{"app_id":"999999999"}}'

I am trying to replicate the log event above using the HttpEventCollectorLogbackAppender. I can send everything to Splunk except the "fields".

I can see that there is a fields property being added in HecJsonSerializer, and that is for metadata not in the MetadataTags.HEC_TAGS set. I think this is what I need, but I can't figure out a way to add metadata outside that Set through the XML configuration. The metadata is list fixed in lines 75-88 of HttpEventCollectorLogbackAppender.java. How can we add metadata like in the curl request above without having to extend HttpEventCollectorLogbackAppender?

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

1 participant