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
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.2.tar.gz
(4.9 kB
view details)
Built Distribution
File details
Details for the file syslogcef-0.1.2.tar.gz
.
File metadata
- Download URL: syslogcef-0.1.2.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7e691e2c4013b661f8848d88d157cf22c5e390c36e688d6f525392f47350a44 |
|
MD5 | 97192d3eb192b531641836335b968891 |
|
BLAKE2b-256 | 7bf1239dad0428e0d1672c1528f0a7d2c6f53495dbae93c41c50fd9419038d3b |
File details
Details for the file syslogcef-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: syslogcef-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 330dfd8520e53cc0f79f82dbec16d6ac490b7cb74cf3b9e8ab569dd8a4c91f27 |
|
MD5 | f95ad0da56acd54faa6fee71426cba3d |
|
BLAKE2b-256 | bbfedce658062f2bad5a73e191b5ed7043fdcf290e81f042e50262a8c3142ac8 |