CEF python class
I work pretty frequently with CEF events that I generate and manipulate with python scripts.
This usually gives pretty ugly and difficult to modify code when CEF parameters need to be manipulated. This is why I wrote my own set of functions (python 2.7) to make this work easier and thought it could be useful for some other people.
There is some documentation and examples included in the attached documents. It looks good to me but hasn't been tested extensively. Should you find a bug, please be kind enough to let me know. Thx
I've tried the stringest method and it doesn't work well with some events I have.
I had to handle CEF event in Python some weeks ago and I'm using a regular expression to split the fields. It works with field values containing "|" and additional field names with characters like "_" of ",".
This is the regex I use, maybe it is helpful to improve your script:
header_fields = strcef.split('| ').split('|')
fields_regex = r"(?:_+)?(?P<_KEY_1>[\w.,_\-:\[\]]+)=(?P<_VAL_1>.*?(?=(?:\s[\w.,_\-:\[\]]+=|$)))"
fields_str = ''.join(strcef.split('| ')[1:])
fields_list = re.findall(fields_regex, fields_str)
Indeed the code was not dealing correctly with events containing a | character in the extension and has been updated.
Special characters in the field names shouldn't be an issue.
If you are still experiencing issues, feel free to send me cef events you have problem with via PM