a logstash http output compatible slack api gateway
I was trying to get a few things out of this service:
-
submit to multiple channels from a single endpoint
-
not have to expose and maintain the slack api endpoint in multiple applications
-
do different things with different types of data
token - your slack token, default: None
host - OPTIONAL: the IP to listen on, default: 0.0.0.0
port - OPTIONAL: the port to listen on, default: 18080
pip install -r requirements.txt
copy slack-gateway.py to /usr/local/bin (or something)
token=x0x0-some-bogus-string /usr/local/bin/slack-gateway.py
I run this under something like supervisord to daemonize it.
docker build -t some/slack-gateway .
docker run -it -p 8080:8080 -e token=x0x0-some-bogus-string some/slack-gateway
docker pull looprock/slack-gateway
send to your default channel via: http://your.endpoint.com:18080
topic - OPTIONAL: prefix for message
message - message content
channels - a list of one or more channels
{"topic": "test", "message": "test with channels as a list", "channels": ["random","general"]}