/elastic-bash

I just don't know why anyone would make an ElasticSearch API with BASH.

Primary LanguageShell

Elasticsearch Bash API

This is a command-line library for interacting with ElasticSearch built on BASH.

is this crazy?

Just maybe crazy enough to work! Or just yes?

why would you do this?

It's just another project designed to improve knowledge of a number of topics.

is it feature complete?

Not even close, never will be.

is it even reasonable to use this?

As what? In production.. No. For fun? Maybe! For frustration? Definitely!

why environment variables?

Where's the fun in me giving you all the answers? The design supports easy transitions to POSIX style parameters or whatever else.

Usage

Each command has configurations that determine how the commands are viewed etc. These are controlled through environment variables. Arguments necessary for the commands are positional arguments.

For example, if you want an overview of a specific index you can run:

$ ./elastic/indices-overview-by-name <indexName>

If you want to view it with column headings, set 'v'.

$ v=true ./elastic/indices-overview-by-name <indexName>

For help use -h as the firt argument.

$ ./elastic/custer-health -h

Configuration

The 'bootstrap' script determines the library path. If you want to change the library path then do so with:

$ export ELASTICSEARCH_BASH_API_PATH=/the/path

Set up the HTTP URL to ElasticSearch. Defaults to: http://0.0.0.0:9200

$ export ELASTICSEARCH_HOST="http://0.0.0.0:9200"

This will have to be run every time you open a terminal, or be put into your .bashrc.

Menu

There's a menu system built in.. Run it with

(for console)

$ ./menu

or

(for windowed)

$ ./menu gui

The menu is clearly incomplete, but easy to modify.

Reference

The following material was used to put this together: