-
Notifications
You must be signed in to change notification settings - Fork 7
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
fix: standalone HECEventwriter #380
Conversation
CLA Assistant Lite bot All contributors have signed the COC ✍️ ✅ |
Where can I find the CLA document and how do I sign it? |
@zugf thanks for the proposed fix! you can find CLA here - CLA.md and Code of Conduct here - CODE_OF_CONDUCT.md. in order to sign CLA and CoC - please post a comment "I have read the CLA Document and I hereby accept the CLA" and then another comment "I have read the Code of Conduct and I hereby accept the Terms" |
I have read the Code of Conduct and I hereby accept the Terms |
I have read the CLA Document and I hereby accept the CLA |
hmm, the update makes sense. Can you please add unit test case for it as well so we can capture this behaviour? |
@zugf we can help you with tests if you don't feel comfortable with approaching them yourself :) |
To avoid code duplication, I’ve refactored test_hec_event_writer into a parametrized test. The last 5 lines of the code have been extracted into a separate unit test. The behaviour will be tested by the last parameter set (create_hec_event_writer__create_from_token__external_host, False). This simulates a machine without a Splunk installation that uses the HEC to push events to a different machine. Existing monkey patch functionality is used to unset SPLUNK_HOME. |
@zugf , can you please sign the commits, and we can proceed to merge the changes (signing commits guide). |
3f1549e
to
764c7b4
Compare
if create_from_token() is used, it will call the HECEventWriter constructor with scheme, host and port set to None. This will result in a call to get_splunkd_access_info() which will throw an exception if the hec uri does not point to the local machine. This call is not needed in that case, so the invocation has been moved inside of the if-statement.
refactor existing hec event writer unit tests add test parameter for external hec event writer
764c7b4
to
93a105f
Compare
Commits are signed. Have a good weekend |
🎉 This issue has been resolved in version 5.1.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
When create_from_token() is invoked, it triggers the HECEventWriter constructor with scheme, host, and port set to None. This leads to a get_splunkd_access_info() call, which throws an exception if the HEC URI doesn’t reference the local machine. As this call is unnecessary in such cases, its invocation has been relocated within the if-statement