Overview
List and manage your ElasticSearch indices easily via command line.
Crafting very verbose JSON object to manipulate and view ElasticSeach indices is really hard!.
Elastictl - a command-line utility can certainly help you in managing ElasticSearch data more easier
Features
- > Simple command, no verbose JSON syntax.
- > Show output in tabular form, like MySQL. No need to read JSON objects
- > Single-file application, no need to meddle with installing Kibana, Sense and its dependencies
- > Makes every tedious operation really easy (renaming fields, listing indices etc)
Installation
Elastictl can be easily installed globally in your machine, it is just a single phar archive which packs everything you need. However, it has a few requirements to run:
- PHP 5.5 or greater
- lib-curl, ext-curl, ext-json extensions enabled
- ElasticSearch Server
For Debian/RHEL OS
For Mac
You can verify the elastictl is installed properly by typing this command while in any folder:
Congrats! you just had installed Scalp in your computer
Configuration
You need to place a configuration file in the folder where you plan to execute this command (usually in the home folder). The configuration file should be named .env . A sample .env file looks like below:
All these configuration options is optional! Yes, you can even just execute elastictl without configuration file at all, but that is assuming you are ok with the default values. When you did not specify a certain value, it will use the default value. This are the default values of each setting and its brief description
Setting | Description | Default Value |
---|---|---|
ES_HOST | database hostname for the ElasticSearch Server | 127.0.0.1 |
ES_PROTOCOL | whether to use SSL or plain http when connecting to ElasticSearch | http |
ES_PORT | port number for ElasticSearch | 9200 |
ES_USER | username to use to connect to ElasticSearch | null |
ES_PASSWORD | password to use to connect to ElasticSearch | null |
ES_TIMEOUT | How long a certain query should wait | 3 |
ES_LOGGING | whether logging is on or off | false |
ES_LOGFILE | what is the location of the log file | /var/log/elastictl.log |
MEMCACHED_SERVER | hostname of the memcached server | 127.0.0.1 |
One other option is to define these variables in your .bash_profile or .bashrc files.