All Projects → rolinh → elastic-go

rolinh / elastic-go

Licence: BSD-3-Clause License
A command-line tool to query the Elasticsearch REST API

Programming Languages

go
31211 projects - #10 most used programming language
Dockerfile
14818 projects
Makefile
30231 projects

Projects that are alternatives of or similar to elastic-go

snap
An Elasticsearch client for Elixir
Stars: ✭ 26 (+52.94%)
Mutual labels:  elasticsearch-client
appbase-swift
Swift Library for appbase.io and ElasticSearch
Stars: ✭ 24 (+41.18%)
Mutual labels:  elasticsearch-client
gatsby-wiki
Creating a Knowledgbase using Gatsby.js and React.js (see final product ->
Stars: ✭ 32 (+88.24%)
Mutual labels:  elasticsearch-client
VaporElasticsearch
A Vapor/Swift Elasticsearch client
Stars: ✭ 26 (+52.94%)
Mutual labels:  elasticsearch-client
elasticlient
C++ Elasticsearch client library
Stars: ✭ 112 (+558.82%)
Mutual labels:  elasticsearch-client
wES
wES is set of open source Java ElasticSearch client and toolkits; Compact, yet highly customizable and powerful.
Stars: ✭ 27 (+58.82%)
Mutual labels:  elasticsearch-client
elastic-crud
Simple yet elegant ElasticSearch Crud Repository.
Stars: ✭ 46 (+170.59%)
Mutual labels:  elasticsearch-client
spring-boot-starter-elasticsearchHighLevelClient
提供elasticsearch-rest-high-level-client连接池功能,同时对接spring-boot-starter
Stars: ✭ 57 (+235.29%)
Mutual labels:  elasticsearch-client
Chewy
High-level Elasticsearch Ruby framework based on the official elasticsearch-ruby client
Stars: ✭ 1,749 (+10188.24%)
Mutual labels:  elasticsearch-client
Elasticsearch Hq
Monitoring and Management Web Application for ElasticSearch instances and clusters.
Stars: ✭ 4,832 (+28323.53%)
Mutual labels:  elasticsearch-client

elastic.go - A command-line tool to query the Elasticsearch REST API

elastic.go was born to turn commands that look like this:

curl -XGET 'http://localhost:9200/_nodes/_all/host,ip' | python -m json.tool

into this:

elastic node list

elastic fetches data from your Elasticsearch instance, formats the data nicely when it is JSON compressed data, and adds a bit of colors to make it more readable to the human eye. It aims at providing shortcuts for all default Elasticsearch routes. For instance, you can get the cluster health with elastic cluster health (or elastic c he for short).

Of course, you can still issue any GET requests with elastic query <YOUR REQUEST HERE> (or elastic q for short), like elastic q twitter/tweet,user/_search?q=user:kimchy'. By design, only GET requests are allowed. I wanted to make it easy to query Elasticseach indexes, not deleting them so use the good old curl -XDELETE ... if this is what you want to achieve. There is currently no support for PUT requests either since I have no use for it. Pull requests are welcome however.

Installation

Providing that Go is installed and that $GOPATH is set, simply use the following command:

go get -u github.com/Rolinh/elastic-go

Make sure that $GOPATH/bin is in your $PATH.

Build a Docker image

A Dockerfile is provided. Simply run the following command to build the Docker image:

docker build -t Rolinh/elastic-go .

Usage

elastic help provides general help:

$ elastic help
NAME:
   elastic - A command line tool to query the Elasticsearch REST API

USAGE:
   elastic [global options] command [command options] [arguments...]

VERSION:
   1.0.0

AUTHOR(S):
   Robin Hahling <[email protected]>

COMMANDS:
   cluster, c   Get cluster information
   index, i     Get index information
   node, n      Get cluster nodes information
   query, q     Perform any ES API GET query
   stats, s     Get statistics
   help, h      Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --baseurl "http://localhost:9200/"   Base API URL
   --help, -h                           show help
   --version, -v                        print the version

Help works for any subcommand as well. For instance:

$ elastic index help
NAME:
   elastic index - Get index information

USAGE:
   elastic index [global options] command [command options] [arguments...]

VERSION:
   1.0.0

COMMANDS:
   docs-count, dc       Get index documents count
   list, l              List all indexes
   size, si             Get index size
   status, st           Get index status
   verbose, v           List indexes information with many stats
   help, h              Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h   show help
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].