shellbot.updaters.elastic module

class shellbot.updaters.elastic.ElasticsearchUpdater(engine=None, **kwargs)[source]

Bases: shellbot.updaters.base.Updater

Writes inbound events to Elasticsearch

An event may be a Message, a Join or Leave notification, or any other Event.

Updaters expose a filtering function that can be connected to the inbound flow of events handled by the Listener.

Example:

updater = ElasticsearchUpdater(host='db.local:9200')
listener = Listener(filter=updater.filter)
get_host()[source]

Provides the Elasticsearch host

Return type:str
on_bond(bot)[source]

Creates index on space bonding

on_init(host=None, index=None, **kwargs)[source]

Writes inbound events to Elasticsearch

put(event)[source]

Processes one event

Parameters:event (Event or Message or Join or Leave) – inbound event

The function writes the event as a JSON document in Elasticsearch.