Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (testpypi.python.org).
Help us improve Python packaging - Donate today!

Stream supervisor events to a logstash instance

Project Description
[![Build Status](https://travis-ci.org/dohop/supervisor-logstash-notifier.svg?branch=master)](https://travis-ci.org/dohop/supervisor-logstash-notifier)

This is a port of the [Supervisor-logging](https://github.com/infoxchange/supervisor-logging) project. Rather than capture loglines, as Supervisor-logging does it's intended to capture the [`PROCESS_STATE`](http://supervisord.org/events.html#event-listeners-and-event-notifications) events that Supervisor emits.

supervisor-logstash-notifier
============================

A [supervisor]( http://supervisord.org/) plugin to stream events to a Logstash instance (for example, Logstash).

Installation
------------

Python 2.7 or Python 3.2+ is required.

```
pip install supervisor-logstash-notifier
```

Note that Supervisor itself does not yet work on Python 3, though it can be
installed in a separate environment (because supervisor-logstash-notifier is a separate
process).

Usage
-----

The Logstash instance to send the events to is configured with the environment
variables:

* `LOGSTASH_SERVER`
* `LOGSTASH_PORT`
* `LOGSTASH_PROTO`

Add the plugin as an event listener:

```
[eventlistener:logging]
command = logstash_notifier
events = PROCESS_STATE
```

If you don't wish to define the environment variables for the entire shell, you can pass them in via Supervisor's
configuration:

```
[eventlistener:logging]
environment=LOGSTASH_SERVER="127.0.0.1",LOGSTASH_PORT="12202",LOGSTASH_PROTO="tcp"
command=logstash_notifier
events=PROCESS_STATE
```

Running with Logstash
---------------------

Logstash can be simply configured to receive events:

```
input {
tcp {
port => 12201
codec => json
}
}

output {
stdout {
codec => rubydebug
}
}
```
Release History

Release History

This version
History Node

0.0.1

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting