Sentry-syslog: Capture events from syslog

TL;DR: My sentry-syslog script can be used as the binary for Rsyslog’s omprog output module to send syslog RFC 5424 messages messages to Sentry as breadcrumbs and events.

I’ve tried a number of different things to proactively track hidden issues on the several Linux hosts I use personally, from my laptop to personal servers. My goal has been very similar to one of Sentry’s mottoes, to discover failures in my systems before the “customer” (me) notices something hasn’t been working. I’m a contributor to and and avid supporter of open source projects, so I thought I’d give self-hosted Sentry a try.

First I tried, go-syslog-sentry-logger, but I couldn’t get it to work nor get any meaningful debugging output from it. Then I tried fluent-plugin-sentry (on GitHub at y-ken/fluent-plugin-sentry), but it had the same problems plus it brought with it a rather large additional dependency, fluentd. Finally, I looked at logstash-output-sentry (on GitHub at javiermatos/logstash-output-sentry), but it’s out of date and has the same dependency issue.

I decided to go with my strengths and write a Rsyslog omprog output module binary script in Python. It’s been working well on a few systems for a few days now so I thought I’d get the word out to other’s who might want something similar. You can find it on GitHub at the link above along with instructions on how you might use it. Let me know if you end up using it, and in general feedback is welcome.