将syslog消息作为事件发送到Sentry
项目描述
sentry-syslog 命令行脚本将 RFC 5424 IETF Syslog协议 消息作为事件发送到Sentry,如下所示
每行接受一条消息
将每条消息转换为Python logging 消息
将Python消息记录到由 Sentry的Python日志集成 处理
安装
使用安装标准Python 3分布的任何工具进行安装,例如 pip
$ sudo pip3 install sentry-syslog
用法
有关选项和参数的详细信息,请参阅命令行帮助
$ 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: ERROR)
该脚本期望它接收的所有syslog行都已经过筛选,只捕获应捕获到Sentry中的行。级别设置仅确定哪些行被捕获为痕迹或事件。
然后可以使用正确的调用,例如,使用 Rsyslog的omprog输出模块 作为 二进制,选择性地将系统的syslog消息作为事件转发到Sentry。请参阅 示例omprog配置,该配置可能如下安装(将需要根据系统进行修改)
$ 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
项目详细信息
关闭
sentry-syslog-0.1.5.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 2ccbdff6893405df7daec2f10ded66c31488afa6f6668e1762619ea75cc5a21d |
|
MD5 | 1a8b90833db8394f2142346b4bf83285 |
|
BLAKE2b-256 | cf266ce1a7108d6210e221fd0faf3a6515d97ed2cfe9447ac36b435e36378446 |
关闭
sentry_syslog-0.1.5-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 34a186650ff932d7fac8c40a35f3be85f7641f5ec23439c74e26ab34b2425969 |
|
MD5 | 5d16d8ed67840381323503f608a6ff4e |
|
BLAKE2b-256 | 04ad6e32420fd1112958a93032905aa790d81f6d96cc419a0d6cc3cc93599bd4 |