Send syslog messages to Sentry as events
Project description
The sentry-syslog command-line script sends RFC 5424 IETF Syslog Protocol message to Sentry as events as follows:
Initializes Sentry’s Python logging integration
Accepts one message per-line
Converts each message into a Python logging message
Logs the Python message to be handled by the Sentry’s Python logging integration
Installation
Install using any tool for installing standard Python 3 distributions such as pip:
$ sudo pip3 install sentry-syslog
Usage
See the command-line help for details on options and arguments:
$ sentry-syslog --help usage: sentry-syslog [-h] [--input-file INPUT_FILE] [--event-level EVENT_LEVEL] sentry_dsn Send syslog messages to Sentry as events. positional arguments: sentry_dsn The DSN for your sentry DSN or client key. optional arguments: -h, --help show this help message and exit --input-file INPUT_FILE, -i INPUT_FILE Take the syslog messages from this file, one per-line. (default: stdin) --event-level EVENT_LEVEL, -e EVENT_LEVEL Capture log messages of this level and above as Sentry events. All other events are captured as Sentry breadcrumbs. (default: 40)
The script expects all the syslog lines it receives to be already filtered down to those that should be captured in Sentry. The level setting only determines which lines are captured as breadcrumbs or events.
The correct invocation can then be used, for example, with Rsyslog’s omprog output module as the binary to selectively forward a system’s syslog messages to Sentry as events. See the example omprog configuration which might be installed as follows (will require adapting to the system):
$ sudo curl https://raw.githubusercontent.com/rpatterson/sentry-syslog/master/src/sentry_syslog/etc/rsyslog.d/99-sentry.conf >/etc/rsyslog.d/99-sentry.conf $ sudo editor /etc/rsyslog.d/99-sentry.conf $ sudo systemctl restart rsyslog.service
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
Built Distribution
Hashes for sentry_syslog-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d62e96d31073cde2ef23e0e624d38fe2908eb933ed5eca42c9573e35a4b41d71 |
|
MD5 | 7ee22f37b11a9449b2e8ca65a9d98139 |
|
BLAKE2b-256 | a74e6f1d18b0bc4f670f47039ce52ed49f500c5e8b76ca17be55aec064d1c5af |