This Hubot plugin enables various operations related to logging:
- record all messages on configured channels to an ElasticSearch server
- enable various commands to interact and query the logs
- serve web pages to browse the logs
- announce to users joining a channel where they can find the logs web page
If you only need to log to ElasticSearch, you can rather use hubot-elasticsearch-logger which only does that.
For low volume channel or for testing purpose, you can use the free service of Bonsai.io elasticsearch hosting.
Warning: This plugin is still in alpha stage. use with caution. It is designed to work fine with the
hubot-irc adapter. Later on it will be tested on slack, gitter and others.
In your hubot dir:
npm install hubot-es-logger --save
Then add to your external-scripts.json
[ 'hubot-es-logger' ]
You will need to set various environment variables to get the logging configured
||yes||the default url where your hubot web server can be reached. By default hubot launches express on port 8080|
||no||'false'||useful to disable logging at bot start in dev env|
||no||'false'||if set, will private message to people joining the channel, signaling the url where to browse the logs|
||yes||the url to your Elasticsearch server|
||yes||comma-separated list of channels to log ie '#trolls,#another_channel,#third'|
||no||'irclogs'||name of the Elasticsearch index|
||no||'false'||if 'true', it will use only one index, but by default, one index is created per day|
||no||if you have a kibana access to your irc logs, it will be displayed on the web page|
||no||the template used in kibana (for building the url)|
Make sure you secure your web interface appropriately (with hubot-restrict-ip or putting hubot behind a proxy).
The web interface for now only shows the last 24 hours of discussion, but it will be configurable, searchable and navigable soon in next versions.
- test coverage (in progress)
log the bot(done 0.1.1) log the join and part of users(done 0.1.1)
- add an indication of logs enabled/disabled to the
- improve error management for web part in case there is no index
add search features on web interface(done in 0.2.0) add time navigation on web interface(done 0.1.2)
- test with slack adapter
- setup a backend pagination system in case of huge quantity of logs per day
Feel free to open a PR if you find any bug, typo, want to improve documentation, or think about a new feature.
Gandi loves Free and Open Source Software. This project is used internally at Gandi but external contributions are very welcome.
- @mose - author and maintainer
This source code is available under MIT license.
Copyright (c) 2016 - Gandi - https://gandi.net