Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including hubot-elk-restore with all npm packages installed. Try it out:

var hubotElkRestore = require("hubot-elk-restore")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

hubot-elk-restore v0.2.1

Elasticsearch Restore/Close API wrapper for Hubot (ELK focused).


Elasticsearch (elk-focused) api wrapper for restoring daily indices, available on npm.


Update Hubot's package.json to install hubot-elk-restore from npm, and update Hubot's external-scripts.json file to include the hubot-elk-restore module.

Update the files to include the hubot-elk-restore module:


"dependencies": {
    "hubot":        ">= 2.4.0 < 3.0.0",
    "hubot-elk-restore": ">= 0.1.0"



Run npm install (hubot will do this on start) to install hubot-elk-restore and dependencies.


Elk-restore supports the following configuration variables, presented with default values:

  • HUBOT_ELK_RESTORE_ES_URL - 'http://localhost:9200/'

If a custom index base is in use, override the default 'logstash-', the default date formatting( is not configurable at this time. You must configure the snapshot repo value for restore commands to function. Include the port (probably 9200) in the ES URL value, and be sure that Hubot has access to your elasticsearch cluster.


Elk-restore is ideal for temporary restoration of daily Elasticsearch indexes (elk). Elk-restore is NOT an index manager (see Curator). Given these requirements, elk-restore answers the following requests:

  • elk indices: describe the currently loaded indices in the elasticsearch cluster
  • elk snapshots: describe the currently available snapshots in the configured snapshot repository
  • elk restore <>: restore the index for the requested day
  • elk close <>: close the index for the requested day


me> hal help elk
hal> elk close <> - Close a particular index
elk indices - Show summary of indices currently available
elk restore <> - Restore a particular index
elk snapshots - Show summary of snapshots available
me> elk indices
hal> ELK indices: logstash-2014.04.05 - logstash-2014.04.18
me> elk snapshots
hal> Elk snapshots: logstash-2014.04.04 - logstash-2014.04.07
me> elk restore 2014.04.04
hal> Restoring logstash-2014.04.04.
me> elk indices
hal> ELK indices: logstash-2014.04.04 - logstash-2014.04.18
me> elk close 2014.04.04
hal> Closing logstash-2014.04.04.
me> elk indices
hal> ELK indices: logstash-2014.04.05 - logstash-2014.04.18
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free