More flexible and SSL-aware#2
Open
vavarachen wants to merge 47 commits intovlad-shevtsov-mev:masterfrom
Open
Conversation
vavarachen
commented
Jan 7, 2018
- Added ability to specify protocol, hostname, source, sourcetype and ssl verification flag
- Hostname is set using socket.gethostname() call
- If 'time' is listed in event body, _time is set to it, otherwise current time is used
- If the event is of dict type, ast code now properly identifies it and preserves it.
-Hostname is set using socket.gethostname() call -If 'time' is listed in event body, _time is set to it, otherwise current time is used If the event is of dict type, ast code now properly identifies it and preserves it
…on. This should help with scalability.
removing has_key with hasattr for py2 & 3 compatibility
Fixed image links
… taken in PyPi. Added docstrings
Pypi preparation
- Fixed _time bug where the log message failed to use to 'time' property specified in the message - Added examples on how to use custom fields
…to logic flaw The 'fields' handling has been reworked to accommodate overriding source, host, time and sourcetype. Previously, these values were declared during init and could not be changed. Now, to override any of those fields, simple include them as part of 'fields' dict in the body of the event.
…tadata. Due to the Splunk bug(?), forcing anything other than list data type to string. dropping field, if tostring() method does not exist.
…g skipped. Updated Readme. Ready for release.
Added code to raise exception if we fail to emit the log record to server (requests failure).
…re resulting in "b'{"text":"Invalid data format","code":6,"invalid-event-number":0}'". Added code to remove empty items from event dict.
…re string (i.e passed as kwargs using configparser) Minor version bump.
- Removed ast.literal_eval for setting port and ssl_verify flags. ast.literal_eval fails to handle int. - Passing extra kwargs like ssl_verify in the event data was causing errors. - added option to specify raw endpoint if field extraction should be skipped. (currently untested)
- Cleaned up init code to use dict get method
close the socket during the exception handler for initial connection
fix leaked socket connection
- Increased default timeout values from 2 to 30. 'timeout' can also be passed during initialization. - Added connection close header. Keep-alive header was causing stability issues. - Improved handing of various data types in log message using serializer method for json dumps.
If path is specified for ssl_verify, it'll never be used. Also cert arg is usually used for client side certs in requests, but didn't remove it for backwards compatibility.
Allow option to remove log_level
Use ssl_verify arg for SSL verification
FIX Handling default timestamp for the log record
* Improved kwargs documentation * Clean-up the documentation (docstring standards are maddening) * Removed the 'cert' argument
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.