Skip to content

More flexible and SSL-aware#2

Open
vavarachen wants to merge 47 commits intovlad-shevtsov-mev:masterfrom
vavarachen:master
Open

More flexible and SSL-aware#2
vavarachen wants to merge 47 commits intovlad-shevtsov-mev:masterfrom
vavarachen:master

Conversation

@vavarachen
Copy link

  • 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.

vavarachen and others added 30 commits December 13, 2017 16:35
-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
removing has_key with hasattr for py2 & 3 compatibility
Fixed image links
- 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
vavarachen and others added 17 commits May 31, 2019 11:41
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
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.

5 participants