hubot-es-logger
v0.2.4
Published
A plugin for Hubot to log channels activity on ElasticSearch, and serve logs via web.
Downloads
13
Readme
Hubot-es-logger
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.
Install
In your hubot dir:
npm install hubot-es-logger --save
Then add to your external-scripts.json
[ 'hubot-es-logger' ]
Configuration
You will need to set various environment variables to get the logging configured
| Variable | required | default | description |
|------------------------------|----------|-----------|---------------------------------------------------|
| HUBOT_BASE_URL
| yes | | the default url where your hubot web server can be reached. By default hubot launches express on port 8080 |
| ES_LOG_ENABLED
| no | 'false' | useful to disable logging at bot start in dev env |
| ES_LOG_ANNOUNCE
| no | 'false' | if set, will private message to people joining the channel, signaling the url where to browse the logs |
| ES_LOG_ES_URL
| yes | | the url to your Elasticsearch server |
| ES_LOG_ROOMS
| yes | | comma-separated list of channels to log ie '#trolls,#another_channel,#third' |
| ES_LOG_INDEX_NAME
| no | 'irclogs' | name of the Elasticsearch index |
| ES_LOG_SINGLE_INDEX
| no | 'false' | if 'true', it will use only one index, but by default, one index is created per day |
| ES_LOG_KIBANA_URL
| no | | if you have a kibana access to your irc logs, it will be displayed on the web page |
| ES_LOG_KIBANA_TEMPLATE
| no | | the template used in kibana (for building the url) |
Web interface
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.
ToDo
- 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
.logs
command - 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
Contribute
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.
Attribution
Authors
- @mose - author and maintainer
License
This source code is available under MIT license.
Copyright
Copyright (c) 2016 - Gandi - https://gandi.net