SLIDE 37
- Rivers allow Elasticsearch to subscribe to
messages from queues directly
- Logstash has an output called
elasticsearch_river
○ Formats messages in RabbitMQ for bulk indexing ○ Contacts Elasticsearch API to configure the river
- Cluster has one River for each Centralized
Logging Server RabbitMQ queue
Elasticsearch River
Time: 1:10
- We’re making use of Elasticsearch Rivers for ingesting messages into the
Elasticsearch cluster. This is similar to a shovel in Elasticsearch terms.
- A separate thread in the Elasticsearch JVM will be dedicated to the river and
will ingest messages formatted for bulk indexing.
- In particular, the RabbitMQ River Elasticsearch plugin creates a thread for an
AMQP client to read in messages from the RabbitMQ queues.
- Logstash has an elasticsearch_river output plugin that will send messages
formatted for the Elasticsearch Bulk API into RabbitMQ, and it will also setup the River thread in the corresponding Elasticsearch cluster.
○
I’m actually using a modified version of the elasticsearch_river plugin.
○
Mine is different because the Logstash processes around our system cannot all reach the Elasticsearch cluster, and I don’t want them each setting up their own copy of the same rivers anyway.
○
I use a Python script talking to the Elasticsearch API to manage the rivers that should be configured at any time instead.
○
It was really easy to take the code that is used in the elasticsearch_river plugin, make a few minor changes, and deploy my “new” plugin alongside all the built-in Logstash plugins.