Piping data from Mongostat to Elasticsearch with Logstash
- Logstash 1.5.x
- If you want to run Logstash 2.x, see the section titled Logstash 2.x below
- Mongostat 2.8+ (for support of the
- Copy all of the files from this gist into your Logstash directory. Put
- Edit the connection information in
conf/logstash.conffor your Elasticsearch output
- If you change the index name, you'll also need to update the template name in
$ mongostat --json -h localhost --port 27017 -u bob -ppassword --authenticationDatabase admin --discover | python mongostat-filter.py | bin/logstash -f conf/logstash.conf
All of these configs should work fine on Logstash 2.x as well, with the exception of two things:
logstash-filter-bytes2humanplugin has not yet been updated for Logstash 2.x support. You'll need to manually install a patched version of this plugin if you wish to run 2.x.
- The syntax for the
logstash-output-elasticsearchplugin has changed
protocoloption has been removed in favor of a separate plugin,
logstash-output-elasticsearch_java, for communicating over protocols other than HTTP.