Skip to main content

Python library to easily send CEF formatted messages to syslog server

Project description

syslogcef

Python library to easily send CEF formatted messages to syslog server.

It uses cefevent to format message payloads and rfc5424-logging-handler to send syslogs.

Install:

pip install syslogcef

Test sending a few messages with:

python3 -m syslogcef.testmessages --host <host> --port <port> --proto [TCP|UDP]

Usage:

from syslogcef import SyslogCEFSender

# Create syslog sender.
syslog = SyslogCEFSender(
    # Syslog server settings:
    host='10.1.2.3', 
    port='514', 
    protocol='TCP', 
    # Hopefully the above names does not clash with any CEF field name.
    # CEF fields applied to all events:
    deviceProduct='MyProgram', 
    deviceVendor='MyCompany',
    deviceVersion='1.0.2')

# Register CEF events.
syslog.register_event('100', name='CPU temp is OK', severity=0)
syslog.register_event('101', name='CPU temp is rising', severity=5)
syslog.register_event('102', name='CPU temp is too high', severity=9, 
    # CEF fields applied to all '102' events:
    reason="Exceeds 70 degres celsius")

# Send one syslog message.
syslog.send('102', message="The CPU temp is 88 degres celsius.", 
    # CEF fields applied only to this event:
    sourceHostName="mydevice.mydomain.com", 
    sourceMacAddress="00:00:ee:00:52:bb")

See cefevent for complete list of fields.

Read the full ArcSight CEF format for more informations.

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

syslogcef-0.1.5.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

syslogcef-0.1.5-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file syslogcef-0.1.5.tar.gz.

File metadata

  • Download URL: syslogcef-0.1.5.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for syslogcef-0.1.5.tar.gz
Algorithm Hash digest
SHA256 7613cdd4f1312ba123cde83f8bd53bfd6ac48f91c16e3427d20ed2039fefb8ef
MD5 29015e0d4854715e35ef2ffa7d726f5f
BLAKE2b-256 a49d6363de74b5f42c1c62a960aeb3d0c488c16f8b4f68fbdb50f850352a44f6

See more details on using hashes here.

File details

Details for the file syslogcef-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: syslogcef-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for syslogcef-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3c3d7869466caa30f821af029a5cd3ec6e00309b63f86eb9ecaee377f183bb52
MD5 7684333fbfa9805b89b952d827bca837
BLAKE2b-256 d20cc4e07df5712627c9d546bb19403716a6e4b269e2aa3acf437494b96ccef5

See more details on using hashes here.

Supported by

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