Skip to main content

A very simple CEF parser.

Project description

# pycef A very simple CEF parser for Python 2/3

I originally wrote this because I wasn’t able to find very many good Python CEF parsers out there. I did find [one by Sooshie](https://github.com/sooshie/cef_parser) that got me started (thanks for sharing, sir!), but I elected to produce my own.

The parse function takes a string containing a single CEF record and returns a dict containing the following keys, as defined in the [CEF format documentation](https://www.protect724.hpe.com/docs/DOC-1072):

  • CEFVersion

  • DeviceVendor

  • DeviceVersion

  • DeviceEventClassID

  • DeviceName

  • DeviceSeverity

If there are any key=value pairs in the “extensions” section (and face it, pretty much every CEF record has these), they’ll also be in the dict, with the dict key name the same as the CEF record’s key name.

## Example Usage
>>> import pycef
>>> cef = 'CEF:0|pycef|python CEF tests|1|2|Test event 1|3| field1=value1 field2=value2 field3=value3'
>>> d = pycef.parse(cef)
>>> d
{'DeviceVendor': 'pycef', 'DeviceProduct': 'python CEF tests', 'DeviceVersion': '1', 'DeviceEventClassID': '2', 'DeviceName': 'Test event 1', 'DeviceSeverity': '3', 'CEFVersion': '0', 'field1': 'value1', 'field2': 'value2', 'field3': 'value3'}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycef-1.2.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pycef-1.2-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file pycef-1.2.tar.gz.

File metadata

  • Download URL: pycef-1.2.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for pycef-1.2.tar.gz
Algorithm Hash digest
SHA256 c6536d72edf7a5f0dee52f305ee13015fcc49efa3fa9e814155cd7f98964f276
MD5 05b1902b60a30e430f07291f13d59bae
BLAKE2b-256 5e36542a47743584fe8578cfcb5dda9cfe663786c24278cd576946d616e5c96d

See more details on using hashes here.

File details

Details for the file pycef-1.2-py3-none-any.whl.

File metadata

  • Download URL: pycef-1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for pycef-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 864c4a69b23aed1b7be50d4d311e38240c5424c2fdcfef18d8656f5deb62809e
MD5 79028e25014430bc2e391fd8c1e2b19a
BLAKE2b-256 cca993b075e1a7f031ceb13d233308b610ce9c5a2b91fc9f86297829a633ff8e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page